Hard link a directory | Unix Linux Forums | UNIX for Advanced & Expert Users

  Go Back    


UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

Hard link a directory

UNIX for Advanced & Expert Users


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 01-14-2011
cokedude cokedude is offline
Registered User
 
Join Date: Feb 2010
Last Activity: 18 October 2014, 7:34 AM EDT
Posts: 407
Thanks: 28
Thanked 9 Times in 9 Posts
Hard link a directory

Is it possible to Hard link a directory? Some people on google say it is possible and some say it is not possible. I haven't seen a working solution though.
Sponsored Links
    #2  
Old 01-14-2011
citaylor's Avatar
citaylor citaylor is offline
Registered User
 
Join Date: Jul 2010
Last Activity: 9 August 2011, 2:12 AM EDT
Location: Somerset, UK
Posts: 405
Thanks: 0
Thanked 72 Times in 70 Posts
Historically its always been impossible. My linux still reports it as being impossible. Ive never witnessed it working.
Sponsored Links
    #3  
Old 01-14-2011
methyl methyl is offline Forum Advisor  
Advisor
 
Join Date: Mar 2008
Last Activity: 18 April 2014, 5:13 AM EDT
Posts: 6,396
Thanks: 287
Thanked 673 Times in 642 Posts
It is impossible. If you must link directories, use a soft link.
    #4  
Old 01-17-2011
hergp hergp is offline Forum Advisor  
Problem Eliminator
 
Join Date: Jan 2010
Last Activity: 30 October 2014, 7:14 AM EDT
Location: Vienna, Austria
Posts: 802
Thanks: 18
Thanked 168 Times in 150 Posts
Hardlinks on directories are not impossible by design - the mkdir system call produces them, look at the "." and ".." entries in the newly created directory - but they are dangerous, because this capability may produce loops in the file hierarchy or otherwise corrupt the file system. (taken from the POSIX man page for the link system call/function, see: Man Page for link (POSIX Section 3) - The UNIX and Linux Forums). Therefore they are not allowed on most Unix implementations.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Difference between hard link and soft link kamakshi s UNIX for Dummies Questions & Answers 2 06-26-2008 08:05 AM
Hard Link vs SOft Link???? skyineyes UNIX for Dummies Questions & Answers 3 05-29-2008 12:38 PM
need some info about symbolic link and hard link detective linux UNIX for Dummies Questions & Answers 2 01-08-2008 06:36 AM
Difference between hard link and soft link in unix RAJACHOKALINGAM UNIX for Dummies Questions & Answers 2 08-01-2006 04:10 AM
Differences between hard link and soft link penguin-friend UNIX for Advanced & Expert Users 3 03-08-2002 02:49 PM



All times are GMT -4. The time now is 02:32 PM.