X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_44,SARE_MSGID_LONG40 X-Spam-Check-By: sourceware.org MIME-Version: 1.0 Date: Mon, 6 Apr 2009 14:46:46 -0500 Message-ID: <75cc17ac0904061246y54f76f40h6611dc982f0a7bdc@mail.gmail.com> Subject: cygwin 1.7 fstat weirdness From: Gregg Reynolds To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Hi, I'm trying to get tokyo cabinet running. I have a strange error. One of the test utilities does: #define TCFILEMODE 00644 // permission of a creating file int fd = path ? open(path, O_RDONLY, TCFILEMODE) : 0; // path = "Makefile" and then fstats: if(fstat(fd, &sbuf) == -1) {...} else { if (!S_ISREG(sbuf.st_mode)){ printf("is dir %d\n", S_ISDIR(sbuf.st_mode)); // added for debugging ...etc... }} What's weird is that fstat says ./Makefile is of type S_ISCHR . I tried the same code in a test program and could not reproduce it. I suppose this is a permissions/security thingee, but then again why would it falsely report that a regular file is a character special file? (The fd is 3) Looking at the Windows security settings I can't see where the problem is. Any idea why this is happening? Thanks, gregg -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/