public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* AW: filename does not exist but test gives true back
@ 2004-04-21 13:17 cygwin.20.job
  2004-04-21 13:30 ` Dave Korn
  0 siblings, 1 reply; 6+ messages in thread
From: cygwin.20.job @ 2004-04-21 13:17 UTC (permalink / raw)
  To: cygwin

> -----Ursprüngliche Nachricht-----
> Von: Corinna Vinschen - corinna-cygwin@cygwin.com
> [mailto:+cygwin+job+2760557170.corinna-cygwin#cygwin.com@spamgourmet.com]
> Gesendet: Mittwoch, 21. April 2004 13:10
> An: cygwin@cygwin.com
> Betreff: Re: filename does not exist but test gives true back (cygwin:
> message 2 of 20)
> 
> On Apr 21 12:38, cygwin.20.job@spamgourmet.com wrote:
> > Hi folk, I have ported a bash-script from UNIX to cygwin and have the
> Problem that test says that the file exist but there is no file with the
> given Name.
> >
> > Here come some command to reproduce the problem.
> >
> >
> > Wed Apr 21  12:36:00  556 ls -al;  if [ -e "load_evu.ctl." ] ;then echo
> "load_evu.ctl." exists;fi;
> > insgesamt 1
> > drwxr-xr-x+   2 F.Braunb Dom?nen-        0 21. Apr 12:28 .
> > drwxr-xr--+  12 F.Braunb ????????        0 21. Apr 12:19 ..
> > -rw-r--r--    1 F.Braunb Dom?nen-      285 21. Apr 12:35 load_evu.ctl
> > load_evu.ctl. exists
> >
> > When I go on in the script and working with a file which does not exist
> I run in trouble.
> >
> > Any idea how to fix it that test says the file exists?
> 
> 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


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: filename does not exist but test gives true back
  2004-04-21 13:17 AW: filename does not exist but test gives true back cygwin.20.job
@ 2004-04-21 13:30 ` Dave Korn
  0 siblings, 0 replies; 6+ messages in thread
From: Dave Korn @ 2004-04-21 13:30 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: filename does not exist but test gives true back
  2004-04-21 14:00 Buchbinder, Barry (NIH/NIAID)
@ 2004-04-21 14:57 ` Dave Korn
  0 siblings, 0 replies; 6+ messages in thread
From: Dave Korn @ 2004-04-21 14:57 UTC (permalink / raw)
  To: cygwin

> -----Original Message-----
> From: cygwin-owner On Behalf Of Buchbinder, Barry (NIH/NIAID)
> Sent: 21 April 2004 14:39

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


  A man walks into his Doctor's office.  "Doctor, whenever I do this it
hurts", he says, twisting his arm into an uncomfortable contorted position
behind his back.

  "Well, Don't Do That Then", the doctor says.  "Next!"

  See also:


http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=%22well+don%27t+d
o+that+then%22&btnG=Search

    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/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: filename does not exist but test gives true back
@ 2004-04-21 14:00 Buchbinder, Barry (NIH/NIAID)
  2004-04-21 14:57 ` Dave Korn
  0 siblings, 1 reply; 6+ messages in thread
From: Buchbinder, Barry (NIH/NIAID) @ 2004-04-21 14:00 UTC (permalink / raw)
  To: cygwin

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@cygwin.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/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: filename does not exist but test gives true back
  2004-04-21 11:09 cygwin.20.job
@ 2004-04-21 11:33 ` Corinna Vinschen
  0 siblings, 0 replies; 6+ messages in thread
From: Corinna Vinschen @ 2004-04-21 11:33 UTC (permalink / raw)
  To: cygwin

On Apr 21 12:38, cygwin.20.job@spamgourmet.com wrote:
> Hi folk, I have ported a bash-script from UNIX to cygwin and have the Problem that test says that the file exist but there is no file with the given Name.
> 
> Here come some command to reproduce the problem.
> 
> 
> Wed Apr 21  12:36:00  556 ls -al;  if [ -e "load_evu.ctl." ] ;then echo "load_evu.ctl." exists;fi;
> insgesamt 1
> drwxr-xr-x+   2 F.Braunb Dom?nen-        0 21. Apr 12:28 .
> drwxr-xr--+  12 F.Braunb ????????        0 21. Apr 12:19 ..
> -rw-r--r--    1 F.Braunb Dom?nen-      285 21. Apr 12:35 load_evu.ctl
> load_evu.ctl. exists
> 
> When I go on in the script and working with a file which does not exist I run in trouble.
> 
> Any idea how to fix it that test says the file exists?

Trailing dots are silently ignored by Windows.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Co-Project Leader          mailto:cygwin@cygwin.com
Red Hat, Inc.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* filename does not exist but test gives true back
@ 2004-04-21 11:09 cygwin.20.job
  2004-04-21 11:33 ` Corinna Vinschen
  0 siblings, 1 reply; 6+ messages in thread
From: cygwin.20.job @ 2004-04-21 11:09 UTC (permalink / raw)
  To: cygwin

Hi folk, I have ported a bash-script from UNIX to cygwin and have the Problem that test says that the file exist but there is no file with the given Name.

Here come some command to reproduce the problem.


Wed Apr 21  12:36:00  556 ls -al;  if [ -e "load_evu.ctl." ] ;then echo "load_evu.ctl." exists;fi;
insgesamt 1
drwxr-xr-x+   2 F.Braunb Domänen-        0 21. Apr 12:28 .
drwxr-xr--+  12 F.Braunb ????????        0 21. Apr 12:19 ..
-rw-r--r--    1 F.Braunb Domänen-      285 21. Apr 12:35 load_evu.ctl
load_evu.ctl. exists

When I go on in the script and working with a file which does not exist I run in trouble.

Any idea how to fix it that test says the file exists?

Regards 

    Franz


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-04-21 14:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-21 13:17 AW: filename does not exist but test gives true back cygwin.20.job
2004-04-21 13:30 ` Dave Korn
  -- strict thread matches above, loose matches on Subject: below --
2004-04-21 14:00 Buchbinder, Barry (NIH/NIAID)
2004-04-21 14:57 ` Dave Korn
2004-04-21 11:09 cygwin.20.job
2004-04-21 11:33 ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).