Re: [OT] Hardlinks and directories

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 12 February 2010 07:23:02 Suvayu Ali wrote:
> $ ln muse test
> ln: `muse': hard link not allowed for directory
> 
> So I did a little searching and found its not exactly a forbidden. So
> far the closest to an understandable explanation/reasoning I came across
> was a discussion in lwn[1]. So my question is how are hardlinks so
> different from softlinks?

If you are familiar with the concept of memory pointers in some (any) 
programming language, this is basically the same thing.

A hard link is a pointer to some data on the disk.

A soft link is a pointer to a pointer.

Now, hard links are not allowed for directories since they would allow for 
creation of loops (a directory containing itself), which is a Bad Idea, since 
it breaks recursion. The filesystem needs to be a *tree* if recursion is to 
function, so loops are forbidden (how would you delete a directory which 
contains itself?).

However, soft links to directories are allowed, since they are just pointers 
to other pointers, which makes them distinguishable from regular pointers 
(hard links), and thus recursion algorithms can work around them ("don't 
follow a symbolic link when recursing" is a typical option you can find in a 
man page of various tools).

HTH, :-)
Marko




-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux