The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > AIX
Google UNIX.COM


AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

More UNIX and Linux Forum Topics You Might Find Helpful
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

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 08-17-2005
Registered User
 

Join Date: Aug 2005
Posts: 9
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
Reply With Quote
Forum Sponsor
  #2  
Old 08-17-2005
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,667
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.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:37 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0