On Thu 04 Apr 2002 10:58, Nicholas Clark <[EMAIL PROTECTED]> wrote:
> On Thu, Apr 04, 2002 at 01:40:31AM +0300, Jarkko Hietaniemi wrote:
> > On Wed, Apr 03, 2002 at 05:37:00PM -0500, Michael G Schwern wrote:
> > > On Wed, Apr 03, 2002 at 11:37:21PM +0300, Jarkko Hietaniemi wrote:
> > > > NFS likely.  I don't know what to do about this, detecting
> > > > that we are on NFS is ENONPORTABLE.
> > > 
> > > Touch a file and see if it's mtime is significantly different than the
> > > current time? :)
> > 
> > That gives you "we *might* be on NFS", when the situation might be
> > any of the "we are on working NFS" (oxymoron?), "we are on something
> > else broken", "your clock is broken", or something else...
> 
> If you can execute `df .` is it portable enough to assume that if a line
> matches m!^\S+:/! then you are on NFS. Or it's probable enough that you
> can issue a warning that you suspect you're on NFS.

True on HP-UX and AIX, but Cygwin - and probably Win32 - will not do a df on a
remote system (your regex won't see that anyway / vs \, but 

a5:/u/usr/merijn 101 > df .
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/u        1024000  331888  649221   34% /u
a5:/u/usr/merijn 102 > cd /l1/tmp
a5:/l1/tmp 103 > df .
Filesystem          kbytes    used   avail %used Mounted on
l1:/tmp             262144   28600  219488   12% /l1/tmp
a5:/l1/tmp 104 >

PC09:/W 501 $ df .
Filesystem           1k-blocks      Used Available Use% Mounted on
C:\Work               16442527   6658109   9784418  41% /W
PC09:/W 502 $ cd //l1/tmp
PC09://l1/tmp 503 $ df .
Filesystem           1k-blocks      Used Available Use% Mounted on
df: `/Z': No such file or directory
df: `/X': no medium
df: `.': No such file or directory
PC09://l1/tmp 504 $ cd /L
PC09:/W 503 $ cd /L
PC09:/L 504 $ df .
Filesystem           1k-blocks      Used Available Use% Mounted on
L:                     8388608   5872640   2515968  71% /L
PC09:/L 505 $

/L is a mounted filesystem from //l1 though the Explorer's share network drive
functionality (NET SHARE ...)

> If you can't run df, or you find no such line, you don't say anything.
> [rather than saying that you aren't on NFS]
> 
> But something is telling me that it's not possible in a portable way to
> suppress error messages about df not being found. And now is not the time to
> start adding probes to Configure for df.
> 
> Nicholas Clark

-- 
H.Merijn Brand        Amsterdam Perl Mongers (http://amsterdam.pm.org/)
using perl-5.6.1, 5.7.3 & 631 on HP-UX 10.20 & 11.00, AIX 4.2, AIX 4.3,
  WinNT 4, Win2K pro & WinCE 2.11.  Smoking perl CORE: [EMAIL PROTECTED]
http:[EMAIL PROTECTED]/   [EMAIL PROTECTED]
send smoke reports to: [EMAIL PROTECTED], QA: http://qa.perl.org

Reply via email to