
Das würde ich jetzt nicht interpretieren. Vielmehr scheint es unterschiedliche Fehler zu geben, je nachdem, ob das Verzeichnis lokal oder auf Samba ist. Was liefert denn os.stat("c:\\rl")?
In der Tat das gleiche wie os.stat("m:\\rl")
Wenn das so ist, ist es ein Fehler im Samba: Samba sollte den gleichen Fehlercode liefern wie Windows im lokalen Fall.
Jedenfalls erklärt dieser Fehlercode das Pythonverhalten. Der Python-Code lautet
hFindFile = FindFirstFile(namebuf, &FileData); if (hFindFile == INVALID_HANDLE_VALUE) { errno = GetLastError(); if (errno == ERROR_FILE_NOT_FOUND) return d; Py_DECREF(d); return win32_error("FindFirstFile", namebuf); }
und die Checkin-Message dazu lautet
revision 2.89 date: 1998/08/06 03:23:32; author: guido; state: Exp; lines: +2 -0 In Win32 version of listdir(), when FindFirstFile() returns ERROR_FILE_NOT_FOUND, return an empty list instead of raising an exception.
Der Grund dieser Änderung (in Python 1.5.2) liegt offenbar in
http://www.codeguru.com/files/CAdvFind.html
Wenn FindFirstFile ERROR_FILE_NOT_FOUND zurückgibt, dann bedeutet das *nicht*, dass es den Pfad nicht gibt, sondern, dass das Verzeichnis leer ist (also das erste File nicht gefunden wurde).
Ciao, Martin
Genau dieser fehlerhafte Rückgabewert scheint in der Tat ein Bug in samba zu sein - siehe Anhänge unten. Es ist wohl nicht anzunehmen, das es ein sinnvolles Vorgehen ist im Python Quellcode einen workaround um diesen samba bug einzupflegen. In der Python Dokumentation wäre ein Hinweis auf diesen Bug sicher nicht verkehrt. Die Existenz eines Samba Verzeichnisses sollte also mit os.stat oder os.path.isdir überprüft werden. Carl Anhang --------------------------------------------------------------------------------- http://samba.cadcamlab.org/lists/samba-technical/Sep2000/00104.html FW: [PATCH] mkdir.cc - mkdir_p() (was: Samba install problems) * To: "SAMBA tecnical list" <samba-technical@samba.org> * Subject: FW: [PATCH] mkdir.cc - mkdir_p() (was: Samba install problems) * From: "Andrej Borsenkow" <Andrej.Borsenkow@mow.siemens.ru> * Date: Thu, 14 Sep 2000 11:03:45 +0400 * Delivered-To: samba-technical@us4.samba.org * Delivered-To: samba-technical@samba.org * Importance: Normal * List-Id: Discussions on Samba internals. For general questions please subscribe to the list samba@samba.org <samba-technical.lists.samba.org> Browsing samba-technical, I remeber the problem with creating directory with missing directories in path. I.e. mkdir -p //samba/foo/bar/com fails if ``bar'' does not exists. I hit it when installing off SAMBA share (2.0.7) Here it seems that one nice person analysed the problem. May be, it helps. The mentioned patch is for Cygwin setup.exe problem, not for SAMBA. regards -andrej
-----Original Message----- From: cygwin-owner@sources.redhat.com [mailto:cygwin-owner@sources.redhat.com]On Behalf Of Harold Hunt Sent: Tuesday, September 12, 2000 7:24 AM To: 'cygwin@sources.redhat.com' Subject: [PATCH] mkdir.cc - mkdir_p() (was: Samba install problems)
Samba 2.0.6+ seems to return ERROR_FILE_NOT_FOUND when a directory in the path handed to CreateDirectory() is not found; earlier versions of Samba seem to follow the Windows convention of returning ERROR_PATH_NOT_FOUND for missing directories.
I sent the patch directly to DJ, and I believe he has reviewed it; this post is merely an announcement to those that may have been following the Samba installation problems thread.
Harold
siehe auch http://sources.redhat.com/ml/cygwin/2000-09/msg00372.html sowie http://www.winehq.com/hypermail/wine-devel/2002/05/0561.html Failures on NT4 in dlls/kernel/tests/path.c From: Francois Gouget (fgouget_at_free.fr) Date: Mon May 20 2002 - 20:06:48 CDT -- +++ GMX - Mail, Messaging & more http://www.gmx.net +++ Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage! _______________________________________________ Python-de maillist - Python-de@python.net http://python.net/mailman/listinfo/python-de