stat'ing "/" vs "//"

Mumit Khan khan@xraylith.wisc.EDU
Sat Apr 17 16:33:00 GMT 1999


Looks like current release of Cygwin stat returns 0 for both "/" and
"//" whereas MSVC and other POSIX runtimes produce -1 for "//". Is
this by design? My shortened version of POSIX doesn't say much about
leading "//" other than saying it's allowed. Can someone check what
the current dev version says?

Here's a trivial test case:

  #include <sys/types.h>
  #include <sys/stat.h>
  #include <stdio.h>

  int 
  main (int argc, char *argv[]) 
  {
    struct stat s;
    printf ("stat (/) = %d\n", stat ("/", &s));
    printf ("stat (//) = %d\n", stat ("//", &s));
    return 0;
  }

Regards,
Mumit



More information about the Cygwin-developers mailing list