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: <20011117234733.6316.qmail@web13904.mail.yahoo.com> Date: Sat, 17 Nov 2001 15:47:33 -0800 (PST) From: chad fowler Subject: directory opening/closing behavior To: cygwin AT cygwin DOT com Cc: chadfowler AT yahoo DOT com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Hello, again. I have a question about the behavior of opening and closing directories. I've noticed some behavior that's inconsistent between Linux and Cygwin, and I'm not sure if it's expected. It has to do with trying to mkdir a directory that still has an open file handle from a previous opendir call. The following program demonstrates it: #include #include #include #include #include int main(void) { int rc; extern int errno; rc = mkdir("_blah", 0777); printf("mkdir %d\n", rc); rc = opendir("_blah"); printf("opendir %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); } 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? Is this something classifiable as a bug? It is obviously good programming practice to close what you open, but it concerns me that the behavior is different between platforms and that the error doesn't happen on rmdir, but only on mkdir. __________________________________________________ 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/