Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <20011118131632.16686.qmail@web13905.mail.yahoo.com> Date: Sun, 18 Nov 2001 05:16:32 -0800 (PST) From: chad fowler Subject: Re: directory opening/closing behavior To: cygwin AT cygwin DOT com In-Reply-To: <1006081063029880@firemail.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Thanks, Katherina. But, I was actually trying to demonstrate the difference in behavior when closedir *isn't* called. I intentially left closedir() out of my example program. So, Corrina is probably right. Thanks to both of you (Katherina and Corrina), Chad --- Katherina O'Connor wrote: > > 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 > #include > #include > #include > #include > > /* (1) */ > #include > > 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" > To: > 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 > > > > > -- > 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/ __________________________________________________ Do You Yahoo!? Find the one for you at Yahoo! Personals http://personals.yahoo.com -- 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/