delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/02/08/18:13:47

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
From: Rolf Campbell <Endlisnis AT mailc DOT net>
Subject: Re: 'errno' bug in cygwin+samba
Date: Sun, 08 Feb 2004 18:13:18 -0500
Lines: 76
Message-ID: <c06fqo$70r$1@sea.gmane.org>
References: <Pine DOT LNX DOT 4 DOT 58 DOT 0402080232070 DOT 21048 AT argon DOT local DOT net>
Mime-Version: 1.0
X-Complaints-To: usenet AT sea DOT gmane DOT org
X-Gmane-NNTP-Posting-Host: cpe0006254406f3-cm014260033562.cpe.net.cable.rogers.com
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4
In-Reply-To: <Pine.LNX.4.58.0402080232070.21048@argon.local.net>

First of all, learn to include the correct headers, and to write valid 
C-code.  Here's what you meant to type.

#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
int main() {
   if(mkdir("test", 0777) < 0)
     perror("mkdir1");
   if(mkdir("test", 0777) < 0)
     perror("mkdir2");
   return 0;
}


2nd of all, I get:
mkdir2: File exists

3rd of all:
http://cygwin.com/problems.html


W.J. van der Laan wrote:
> Hello,
> 
> Today I stumbled on a really strange bug in Cygwin and Samba: errno 2 is
> returned when attempting to create a file or directory that already
> exists.
> 
> #include <stdlib.h>
> #include <unistd.h>
> void main() {
>         if(mkdir("test", 0777) < 0)
>                 perror("mkdir1");
>         if(mkdir("test", 0777) < 0)
>                 perror("mkdir2");
> }
> 
> Gives a  "mkdir2: No such file or directory." huh?
> 
> This happens on more occasions; execute this on a mounted samba filesystem
> under windows, like /cygdrive/p/...
> 
> 
>>>>import shelve
>>>>shelve.open("test", flag='c')
>>>>shelve.open("test", flag='c')
> 
> Traceback (most recent call last):
>   File "./test.py", line 3, in ?
>     shelve.open("test", flag='c');
>   File "/usr/lib/python2.3/shelve.py", line 231, in open
>     return DbfilenameShelf(filename, flag, protocol, writeback, binary)
>   File "/usr/lib/python2.3/shelve.py", line 212, in __init__
>     Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback,
> binary)
>   File "/usr/lib/python2.3/anydbm.py", line 83, in open
>     return mod.open(file, flag, mode)
>   File "/usr/lib/python2.3/dbhash.py", line 16, in open
>     return bsddb.hashopen(file, flag, mode)
>   File "/tmp/python.2664/usr/lib/python2.3/bsddb/__init__.py", line 192,
> in hashopen
> bsddb._db.DBNoSuchFileError: (2, 'No such file or directory')
> Exception exceptions.AttributeError: "DbfilenameShelf instance has no
> attribute 'writeback'" in  ignored
> 
> It gives an 'No such file or directory' the second time, while the shelve
> is succesfully created. It seems to produce this error when a file already
> exists.
> This essentially makes shelve useless under cygwin.
> 
> Greetings,
> Wladimir
> 


--
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/

- Raw text -


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