delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/11/18/05:58:28

Date: Sun, 18 Nov 2001 05:58:28 -0500
Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Posted-Date: Sun, 18 Nov 2001 11:57:43 +0100 (MET)
From: "Katherina O'Connor" <oconnor AT firemail DOT de>
To: cygwin AT cygwin DOT com
Message-ID: <1006081063029880@firemail.de>
X-Mailer: Caramail - www.caramail.com
X-Originating-IP: [213.6.59.109]
Mime-Version: 1.0
Subject: Re: directory opening/closing behavior

--=_NextPart_Caramail_0298801006081063_ID
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

> Exactly what you've described. It's a 
> Windows feature which isn't POSIX compatible 
> and for which a workaround would be
> extremly difficult.

Sorry, this isn't a "Windows feature" but 
POSIX compatible and a workaround would be 
extremly simple, because Chad Fowler made
a simple mistake: he forgotten to call 
closedir() before rmdir():

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

/* (1) */
#include <sys/dirent.h>

int main(void)
{
 int rc;
 extern int errno;

 /* (2) */
 DIR* pDIR; 

 rc = mkdir("_blah", 0777);
 printf("mkdir %d\n", rc);

 pDIR = opendir("_blah");
 printf("opendir %d\n", ( long ) pDIR);

 /* (3) */
 rc = closedir( pDIR );
 printf("closedir %d\n", rc);

 rc = rmdir("_blah");
 printf("rmdir %d\n", rc);

 rc = mkdir("_blah", 0777);
 printf("mkdir %d\n", rc);
 printf("errno: %d\n", errno);
}

#if 0

Cygwin output:
mkdir 0
opendir 167839600
closedir 0
rmdir 0
mkdir 0
errno: 0

Linux output:
mkdir 0
opendir 134518696
rmdir 0
mkdir 0
errno: 38

#endif

----- Original Message ----- 
From: "Corinna Vinschen" <cygwin AT cygwin DOT com>
To: <cygwin AT cygwin DOT com>
Sent: Sunday, November 18, 2001 10:12 AM
Subject: Re: directory opening/closing behavior


> On Sat, Nov 17, 2001 at 03:47:33PM -0800, chad fowler wrote:
> > Cygwin output:
> > mkdir 0
> > opendir 167839552
> > rmdir 0
> > mkdir -1
> > errno: 13
> > 
> > Linux output:
> > mkdir 0
> > opendir 134518696
> > rmdir 0
> > mkdir 0
> > errno: 38
> > 
> > After having run, the directory "_blah" exists in
> > Linux but doesn't exist in Cygwin.
> > 
> > What's the expected behavior?
> 
> Exactly what you've described. It's a Windows feature which
> isn't POSIX compatible and for which a workaround would be
> extremly difficult.
> 
> Corinna
> 
> -- 
> Corinna Vinschen Please, send mails regarding Cygwin to
> Cygwin Developer mailto:cygwin AT cygwin DOT com
> Red Hat, Inc.
> 
> --
> Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting: http://cygwin.com/bugs.html
> Documentation: http://cygwin.com/docs.html
> FAQ: http://cygwin.com/faq/
> 
> 
> 
> 
______________________________________________________
Kein Schwein klickt mich an? Tragen Sie Ihre Site doch einfach im
Fireballkatalog ein! http://www.fireball.de/katalogeintrag.html




--=_NextPart_Caramail_0298801006081063_ID
Content-Type: text/plain; charset=us-ascii

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
--=_NextPart_Caramail_0298801006081063_ID--

- Raw text -


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