Re: [OT] Hardlinks and directories

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

 



On Friday 12 February 2010 08:12 PM, Marko Vojinovic wrote:
> On Saturday 13 February 2010 00:09:38 Suvayu Ali wrote:
>> On Friday 12 February 2010 06:06 AM, Marko Vojinovic wrote:
>>> 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?).
>>
>> I don't quite follow you here, don't you mean hardlinking directories
>> have the risk of introducing recursion?
>
> No, I am saying that hard linking directories allows creation of loop
> structures. These structures break any recursive algorithm that tries to go
> "downwards" in some directory structure.
>
> Deleting directories is a textbook example. In order to delete a directory,
> you first have to delete all files and subdirectories that it contains, and once
> it is empty, delete the directory itself. So deletion goes on via a recursive
> algorithm:
>
> 1) check whether there are files or dirs in target dir
> 2) delete any files present
> 3) execute yourself (from step 1) for every subdir as target dir
> 4) target dir is now empty, unlink it
> 5) done

I think I had misunderstood what you said the first time. I wasn't 
thinking in terms of the algorithm traversing through the directories. 
:-p Its all clear now.

> Best, :-)
> Marko
>

Thanks a lot everyone. This has been incredibly educational. :)
-- 
Suvayu

Open source is the future. It sets us free.
-- 
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