Finding the Link, the Hard Link
David Walker
dave at mudsite.com
Wed Mar 15 14:47:29 UTC 2006
Will H. Backman wrote:
> David Walker wrote:
>> OK, sorry for the sappy subject but oh well.
>>
>> So I am having a question and problem. What I am doing is writing a
>> script to parse over 2 loop file systems, and check for changes.
>> Simple, no? Well I thought so until I ran into the HardLink. This
>> would be able to be ignored and just put 2 copies of the file in the
>> loop filesystem, however we are pressed for space and every 4k
>> matters. So I ask, is there a way to tell the difference between the
>> real file, and a hard link?
>>
>> eg.
>> /etc/passwd and /etc/passwd.hl
>>
>> The .hl was made with ln, now how can I tell that it is, or was made
>> with ln, a hard link?
>>
>> --
>> Dave
>>
>
> As far as I know, every regular file is a hard link. Creating a new
> hard link to the inode doesn't increase the size on disk.
>
Right. But for what I need this to do, is such:
There is a file /etc/passwd. I make a hard link, /etc/passwd.hl.
Now, I am going to check the filesystem: and I see /etc/passwd, and note
that it has not changed. Then I check /etc/passwd.hl and note that it
is another (made by ln) link.
I don't think what I am trying to do is possible but I was wondering if
I am missing something.
--
dave
More information about the ubuntu-users
mailing list