[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gcmd-dev] find -samefile as gcmd menu program
From: |
Micha |
Subject: |
[gcmd-dev] find -samefile as gcmd menu program |
Date: |
Fri, 24 Nov 2006 00:50:00 +0100 |
User-agent: |
Alpenglühn 7.2 |
I spent some hour on a script exchanging symlinks
by hardlinks, because i need to export stuff via NFS
and it turned out there are weird problems with
absolute-pathed symlinks on exported filesystems.
Thus the need to get information about hardlinked files,
which i implemented as seperate snippet inside my
gcmd-swiss-army-knife wrapper script.
This is the part of that script ('gnome-commander-tools'):
[ stuff ]
case $choice in
linkinfo) # show symlink target or hardlinks (xmessage uglyness)
case `find $1 -type l` in
'') xmessage "Hardlinks: `find -samefile $1`"
;;
*) xmessage "Symbolic link pointing to:
`find $1 -type l -printf '%l\n'`"
;;
esac
;;
[ more stuff ]
esac
(and yes the symlink piece *does* contain this newline formatting)
The Options -> Program command is "gnome-commander-tools linkinfo"
The symlink piece is working fine from shell and gnome-commander menu too.
Example:
If i apply the gcmd menu entry to a symlink, gcmd logs:
[GG] running: gnome-commander-tools linkinfo '/tmp/nocheinlink'
and xmessage says:
Symbolic link pointing to:
/tmp/test3
Now AAA be a plain simple file with no further hardlinks (than one for
itself). I can run this command in a shell:
gnome-commander-tools linkinfo /tmp/AAA
and the xmessage box spits out: "Hardlinks: ./AAA"
Now i select the file AAA in gcmd and run the menu entry
(we remember, it already works fine for symlinks).
Now gcmd logs:
[GG] running: gnome-commander-tools linkinfo '/tmp/AAA'
and xmessage says, "Hardlinks:" -- nothing more.
Another example, i created some hardlinks to the file TEST.
The shell command "gnome-commander-tools linkinfo /tmp/TEST" gets:
Hardlinks: ./test1
./TEST
./==test1
./===test1-symlink
The same through gcmd gets: "Hardlinks:" fullstop.
gcmd logs:
[GG] running: gnome-commander-tools linkinfo '/tmp/TEST'
... it's driving me mad.
Any explanation ?
ps.
I don't know if that's anyhow related, but before any of these commands
gcmd logs also:
(gnome-commander:14899): GLib-GObject-CRITICAL **: g_object_ref: assertion
`G_IS_OBJECT (object)' failed
pps. attached the whole script -- all this stuff is not yet whitespace-clean.
m°
gnome-commander-tools
Description: Binary data
- [gcmd-dev] find -samefile as gcmd menu program,
Micha <=