www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1999/04/17/18:33:46

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com
Message-Id: <199904172332.SAA14578@modi.xraylith.wisc.edu>
X-Authentication-Warning: modi.xraylith.wisc.edu: localhost.xraylith.wisc.edu [127.0.0.1] didn't use HELO protocol
To: cygwin-developers AT sourceware DOT cygnus DOT com
Subject: stat'ing "/" vs "//"
Date: Sat, 17 Apr 1999 18:32:56 -0500
From: Mumit Khan <khan AT xraylith DOT wisc DOT EDU>

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019