bug-coreutils
[Top][All Lists]
Advanced

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

bug#6555: stat enhancement


From: Pádraig Brady
Subject: bug#6555: stat enhancement
Date: Wed, 25 Aug 2010 22:54:34 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

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.

Attachment: stat-mnt.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]