Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Is @AltName working correctly?

May
855
0
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]
 
And documentation for @AltName says (and I quote): "If the file does not exist, returns an empty string."

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."
 
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!!!
 
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
 
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?
 
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).
 
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).
 
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.
 
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

Back
Top