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

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
Message-ID: <F76C9B2DA2FC4C4CA0A18E288BBCBCF708217800@nihexchange24.nih.gov>
From: "Buchbinder, Barry (NIH/NIAID)" <BBuchbinder AT niaid DOT nih DOT gov>
To: cygwin AT cygwin DOT com
Subject: RE: filename does not exist but test gives true back
Date: Wed, 21 Apr 2004 09:39:20 -0400
MIME-Version: 1.0
X-IsSubscribed: yes
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id i3LDdlmb008711

What is "WDDTT"?  It's not in OLOCA, wtf doesn't know about it, and Google
gives only 4 hits, none of them relevant.

-----Original Message-----
From: Dave Korn
Sent: Wednesday, April 21, 2004 9:28 AM
To: cygwin AT cygwin DOT com
Subject: RE: filename does not exist but test gives true back

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

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