in reply to How to determine if a file is a mount point?
$File::Find::topdev is simply the device associated with the root directory /:use File::Find; File::Find::find({wanted => \&wanted}, '/'); exit; sub wanted { my ($dev,$ino,$mode,$nlink,$uid,$gid); (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_)) && !($File::Find::prune |= ($dev != $File::Find::topdev)) && print("$name\n"); }
($File::Find::topdev) = lstat("/");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to determine if a file is a mount point?
by gw1500se (Beadle) on Jun 29, 2008 at 08:59 UTC | |
by pc88mxer (Vicar) on Jun 29, 2008 at 15:02 UTC | |
by grep (Monsignor) on Jun 29, 2008 at 15:04 UTC | |
by gw1500se (Beadle) on Jun 30, 2008 at 22:18 UTC |