This is the mail archive of the cygwin-developers@sourceware.cygnus.com
mailing list for the Cygwin project. See the Cygwin
home page for more information.
stat'ing "/" vs "//"
- To: cygwin-developers@sourceware.cygnus.com
- Subject: stat'ing "/" vs "//"
- From: Mumit Khan <khan@xraylith.wisc.EDU>
- Date: Sat, 17 Apr 1999 18:32:56 -0500
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