![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Symbolic Links - BASH Script | rodrimuino | Shell Programming and Scripting | 4 | 09-05-2007 07:42 PM |
| cp a dty without symbolic links? | JAKEZ | SUN Solaris | 7 | 09-21-2004 09:55 AM |
| Too many levels of symbolic links | Bab00shka | UNIX for Dummies Questions & Answers | 2 | 09-19-2003 09:15 AM |
| Symbolic Links for a File | b_u_n_1234 | UNIX for Dummies Questions & Answers | 4 | 03-06-2002 09:58 AM |
| Finding symbolic links | mehtad | UNIX for Dummies Questions & Answers | 2 | 11-15-2001 03:26 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Symbolic Links
I am linking a directory as follows:
ln -sf /home/xxx/userid/real_files/* /home/xxx/userid/linked_files This gives me symbolic links for all the files in the real_files directory in the linked_files directory. My question is, if I go and remove a file in the real_files directory and then go back to the linked_files directory and do an ls -l <file_name> that file shows up. Is this a known problem ? Even if I redo the link the file still appears to be in the real_files directory, the only way to remove the reference (that I've found) is to remove my linked_files directory and then do the link command again. Thanks |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Yes symbolic links can daggle. That is they can point to a non-existent file. They are supposed to do that and would be useless if they didn't. Remember that the main reason for symbolic was to cross mount points so you can create a symbolic link to a file in another file system. Now take your case and suppose that /home/xxx/userid/real_files is a mount point. When you unmount /home/xxx/userid/real_files, those symlinks are daggling. And during boot-up they will daggle until /home/xxx/userid/real_files is mounted.
And even if you think that symlinks should disappear when they daggle, that would be hard to do. There is no list of smylinks to a file. So finding the symlinks would involve searching for them. And what if the symlink resides on a filesystem not currently mounted? When it was finally was mounted it would have daggling symlinks. And there are other even more arcane problems that would happen with trying to do this. In your case though, you could just remove the one daggling symlink. You don't need to recreate the whole directory. |
||||
| Google The UNIX and Linux Forums |