[comp.lang.perl] Ultrix NFS bug

rep@genrad.com (Pete Peterson) (04/27/91)

In article <1991Apr16.132824.29138@cunixf.cc.columbia.edu> fom2@cunixf.cc.columbia.edu writes:
 >
 >  I can get the constructed perl to pass all the tests except
 >   io/fs test 18. This is a test that calls utime to modify the atime
 >  and mtime of a test file, and seems to fail by not modifying said
 >  times. I'm reluctant to use perl seriously until I'm sure it works
 >  properly. Any ideas?
This is revealing a DEC bug, not a perl bug.

 I've discovered that Ultrix 4.1 has a bug wherein if you use utime[s] to
change the date of an NFS mounted file, the timestamp gets modified on the
server where the file resides, but not on the local Ultrix machine from
which you're executing.  It doesn't matter if the remote machine is a DEC
or SUN machine.  To maintain bug consistency, DEC thoughtfully included
this bug in both the VAX and MIPS (pmax) versions of Ultrix 4.1.  It was
not broken in 4.0.  Either ls -ls or stat on the local machine give the
wrong timestamp, but they give the right one when executed on the remote
machine.

The following simple-minded C code sets the time stamp on a file to
1 Jan 1991.  You can use it to demonstrate the broken Ultrix.
#include <sys/types.h>
#include <stdio.h>
main(argc,argv)
int argc;
char *argv[];
{
  struct  utimbuf  {
    time_t  actime;    /* access time */
    time_t  modtime;   /* modification time */
  } times;

  times.actime = 662709600;
  times.modtime = 662709660;
  utime(argv[1], &times);
}