Ignore-owner, delete the file with an inode with less link count

16 views
Skip to first unread message

grepalya

unread,
Aug 24, 2006, 2:56:01 AM8/24/06
to hardlink-py
I created a version which is extended two ways:

An option is added:
-o, --owner-ignore User and group ownerships do NOT have to be
identical

Behavior is changed a bit. In the modified version the program always
deletes the
file with the less hard link count and creates the link to the one with
the higher.

This can be useful if you have many similar directories and want to run
hardlink
incrementally. See the following example:

# ls -ali */a
145355 -rw-r--r-- 3 root root 1 Aug 24 08:44 1/a
145355 -rw-r--r-- 3 root root 1 Aug 24 08:44 2/a
145354 -rw-r--r-- 3 root root 1 Aug 24 08:44 3/a

The result of
#hardlink.py 2 3
is never

# ls -ali */a
145355 -rw-r--r-- 3 root root 1 Aug 24 08:44 1/a
145354 -rw-r--r-- 3 root root 1 Aug 24 08:44 2/a
145354 -rw-r--r-- 3 root root 1 Aug 24 08:44 3/a

but always

# ls -ali */a
145355 -rw-r--r-- 3 root root 1 Aug 24 08:44 1/a
145355 -rw-r--r-- 3 root root 1 Aug 24 08:44 2/a
145355 -rw-r--r-- 3 root root 1 Aug 24 08:44 3/a

John Villalovos

unread,
Aug 24, 2006, 10:10:06 PM8/24/06
to hardlink-py
grepalya wrote:
> I created a version which is extended two ways:

Feel free to send a patch in and I can see about applying it.

> An option is added:
> -o, --owner-ignore User and group ownerships do NOT have to be
> identical

Okay.


> Behavior is changed a bit. In the modified version the program always
> deletes the
> file with the less hard link count and creates the link to the one with
> the higher.

I don't understand what you mean. I read it a few times and could not
understand what you are trying to say. Maybe if I see the patch I will
understand.

Thanks,
John

Reply all
Reply to author
Forward
0 new messages