GNU bug report logs - #6555
stat enhancement

Previous Next

Package: coreutils;

Reported by: A Burgie <dajoker <at> gmail.com>

Date: Fri, 2 Jul 2010 20:55:01 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #79 received at 6555 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: A Burgie <dajoker <at> gmail.com>
Cc: 6555 <at> debbugs.gnu.org
Subject: Re: bug#6555: stat enhancement
Date: Wed, 25 Aug 2010 22:54:34 +0100
[Message part 1 (text/plain, inline)]
As a follow up to df not outputting bind mounts,
here is the amended stat -c%m patch than _does_
resolve bind mounts. I was mulling over an option
to output the mount point of the base device
for a file, but one can just use df -P for that now,
or run stat in a loop like:

mp=; lp=/your/file/name
while [ "$lp" != "$mp" ]; do
  mp=$lp; lp=$(./src/stat -c%m "$mp")
done
echo $lp

Some example output in the presence of bind mounts:

$ mount | column -t | grep git
/dev/shm/tdir                      on  /home/padraig/git/tdir
/home/padraig/git/tfile            on  /dev/shm/tdir/tfile
/home/padraig/git/t/coreutils/t/1  on  /home/padraig/git/t/coreutils/t/2
/home/padraig/git/t/coreutils/t/1  on  /home/padraig/git/t/coreutils/t/3
/home/padraig/git/t/coreutils/t/f  on  /home/padraig/git/t/coreutils/t/bf

~/git/t/coreutils$ ./src/stat -c%m /home/padraig/git/tdir/tfile /dev/shm/tdir/tfile t/2 t
/dev/shm/tdir
/home/padraig/git/tfile
/home/padraig/git/t/coreutils/t/1
/home

cheers,
Pádraig.
[stat-mnt.diff (text/x-patch, attachment)]

This bug report was last modified 14 years and 273 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.