delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/04/21/09:29:38

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
From: "Dave Korn" <dk AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RE: filename does not exist but test gives true back
Date: Wed, 21 Apr 2004 14:27:59 +0100
MIME-Version: 1.0
In-Reply-To: <AE9593E6D161544D82CEFCA0552EEAAE011D87A5@ebexbn01.dpeb.de>
Message-ID: <NUTMEGOVxdP91LuYDV30000053f@NUTMEG.CAM.ARTIMI.COM>
X-OriginalArrivalTime: 21 Apr 2004 13:27:59.0390 (UTC) FILETIME=[76C41BE0:01C427A4]
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    <DIR>          .
21/04/2004  14:21    <DIR>          ..
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/


- Raw text -


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