Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 From: "Dave Korn" To: Subject: RE: filename does not exist but test gives true back Date: Wed, 21 Apr 2004 14:27:59 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" In-Reply-To: Message-ID: X-OriginalArrivalTime: 21 Apr 2004 13:27:59.0390 (UTC) FILETIME=[76C41BE0:01C427A4] Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id i3LDTZ70005394 > -----Original Message----- > From: cygwin-owner On Behalf Of cygwin.20.job > Sent: 21 April 2004 12:33 > > -----Ursprüngliche Nachricht----- > > Von: Corinna Vinschen - corinna-cygwin > > > > Trailing dots are silently ignored by Windows. > > > The problem is hat I passed the filename with the trailing > dot to a Windows-Program which produced errors and corrupted > the file without trailing dot. > > Any idea how to fix it? > > Franz I'm afraid this is a case of WDDTT. You simply can't. Windoze is utterly incapable of distinguishing between a filename that ends in a dot and the same name without a dot at the end: it regards them as exactly the same name. This is a leftover from the days of dos 8.3 names; a file called "file" has no extension, and so for old style short dos names to work, it has to be possible to refer to it as "file." - that is to say, it has a null extension, and so the dot is optional. Example: -------->snip!<-------- C:\artimi.src\davek\dot>echo Hello world >file.test C:\artimi.src\davek\dot>type file.test Hello world C:\artimi.src\davek\dot>type file.test. Hello world C:\artimi.src\davek\dot>dir Volume in drive C has no label. Volume Serial Number is 942E-907E Directory of C:\artimi.src\davek\dot 21/04/2004 14:21 . 21/04/2004 14:21 .. 21/04/2004 14:21 14 file.test 1 File(s) 14 bytes 2 Dir(s) 106,017,673,216 bytes free C:\artimi.src\davek\dot>dir file.test Volume in drive C has no label. Volume Serial Number is 942E-907E Directory of C:\artimi.src\davek\dot 21/04/2004 14:21 14 file.test 1 File(s) 14 bytes 0 Dir(s) 106,017,673,216 bytes free C:\artimi.src\davek\dot>dir file.test. Volume in drive C has no label. Volume Serial Number is 942E-907E Directory of C:\artimi.src\davek\dot 21/04/2004 14:21 14 file.test 1 File(s) 14 bytes 0 Dir(s) 106,017,673,216 bytes free C:\artimi.src\davek\dot> -------->snip!<-------- The *only* solution is to rework your program so it doesn't rely on having identically-named files that differ only in a trailing dot. Why not use a trailing ~ insted? That's a fairly *nix way of doing things. cheers, DaveK -- Can't think of a witty .sigline today.... -- 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/