Is @AltName working correctly?

May 24, 2010
855
0
Northlake, Il
Very simple:

[Z:\]dir sample.txt /k /m
TCC: (Sys) The system cannot find the file specified.
"Z:\sample.txt"

[Z:\]Echo %@AltName[sample.txt]
Z:\sample.txt

And documentation for @AltName says (and I quote): "If the file does not exist, returns an empty string."

TCC 12.11.76 Windows 7 [Version 6.1.7601]
 
May 24, 2010
855
0
Northlake, Il
It seems that the sentence before in the Help takes precedence: "If the file name is already in 8.3 format, returns the file name. If the file does not exist, returns an empty string."
David, it would seem that you are correct, although I certainly wouldn't have expected that. However, there are several possible and easy workarounds for the issue. Thank you!!!
 
Jan 19, 2011
614
15
Norman, OK
It seems that the sentence before in the Help takes precedence: "If the filename is already in 8.3 format, returns the filename. If the file does not exist, returns an empty string."

How about this then?

HTML:
[C:\temp]
12:49:06 $ dir name_not_in_8.3_format.txt /k /m
TCC: (Sys) The system cannot find the file specified.
 "C:\temp\name_not_in_8.3_format.txt"

[C:\temp]
12:49:56 $ echo %@AltName[name_not_in_8.3_format.txt]
C:\temp\name_not_in_8.3_format.txt
 
May 24, 2010
855
0
Northlake, Il
How about this then?

HTML:
[C:\temp]
12:49:06 $ dir name_not_in_8.3_format.txt /k /m
TCC: (Sys) The system cannot find the file specified.
 "C:\temp\name_not_in_8.3_format.txt"

[C:\temp]
12:49:56 $ echo %@AltName[name_not_in_8.3_format.txt]
C:\temp\name_not_in_8.3_format.txt
John, am I wrong, or have you effectively just proved that the statement "If the file does not exist, returns an empty string." is false?
 
Jan 19, 2011
614
15
Norman, OK
John, am I wrong, or have you effectively just proved that the statement "If the file does not exist, returns an empty string." is false?
I didn't prove anything; I just provided a counter-example (too many years of discrete mathematics and calculus make me provide that distinction).
 
May 20, 2008
603
0
Sammamish, WA
From my own testing, it seems that a file which does not exist is returned as-is. If the file does exist, it returns the SFN of the file and path, if one is included in the string.-- Sent from my HP TouchPadOn Nov 8, 2011 13:38, JohnQSmith <> wrote: ---Quote (Originally by mathewsdw)---
John, am I wrong, or have you effectively just proved that the statement "If the file does not exist, returns an empty string." is false?
---End Quote---
I didn't prove anything; I just provided a counter-example (too many years of discrete mathematics and calculus make me provide that distinction).
 
May 20, 2008
12,165
133
Syracuse, NY, USA
On Tue, 08 Nov 2011 16:38:52 -0500, JohnQSmith <> wrote:

|---Quote (Originally by mathewsdw)---
|John, am I wrong, or have you effectively just proved that the statement "If the file does not exist, returns an empty string." is false?
|---End Quote---
|I didn't prove anything; I just provided a counter-example (too many years of discrete mathematics and calculus make me provide that distinction).

Huh? A counter-example is the classic proof of falsehood.
 
Jan 19, 2011
614
15
Norman, OK
Huh? A counter-example is the classic proof of falsehood.

I know, I meant one of those long, drawn out, boring, given this, assuming that kind of proofs.
 

Similar threads