in reply to Re^2: How best test that a directory is a mount point of a mounted filesystem?
in thread How best test that a directory is a mount point of a mounted filesystem?
IIRC solaris uses /etc/mnttab, so you could do something like this:
my ($mtab, $mounted); $mounted = 0; if($^O eq 'linux') { $mtab = '/etc/mnttab'; } else { $mtab = '/etc/mtab'; } open my $mounts, "<$mtab" or die($!); while(<$mounts>) { if($_ =~ /\S+ (\S+) .*/) { $mounted = 1 if($1 eq '/opt/mymountpoint'); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How best test that a directory is a mount point of a mounted filesystem?
by jh- (Scribe) on Jan 27, 2009 at 18:00 UTC | |
by regexes (Hermit) on Jan 28, 2009 at 12:26 UTC |