File size = -2?

May 20, 2008
11,400
99
Syracuse, NY, USA
There was another thread about this. It persists. Using 'a' to qualify 'z' in PDIR gives misleading results.

Code:
v:\> pdir /(zc fpn) ftp://ilucky/???????
        <DIR>   ftp://ilucky/MAT122
              0 ftp://ilucky/nobytes

v:\> pdir /(zac fpn) ftp://ilucky/???????
        <DIR>   ftp://ilucky/MAT122
             -2 ftp://ilucky/nobytes

In both cases, the server responded with 0.

And, the help says: "A question mark ? matches any single filename character" when in fact it seems to match 0 or 1 character (above, for example). If that's WAD, the help should say so.
 

rconn

Administrator
Staff member
May 14, 2008
12,345
150
> And, the help says: "A question mark? matches any single filename
> character" when in fact it seems to match 0 or 1 character (above, for
> example). If that's WAD, the help should say so.

That's not TCC, that's the file system you're using.

In Windows, a ? matches a single character, or possibly no character if it's
at the end of the filename. But it's too confusing to qualify that in the
help by saying "depending on the OS, the file system, and where you've put
the ? in the name."
 

rconn

Administrator
Staff member
May 14, 2008
12,345
150
> There was another thread about this. It persists. Using 'a' to qualify
> 'z' in PDIR gives misleading results.
>
> Code:
> ---------
> v:\> pdir /(zc fpn) ftp://ilucky/???????
> <DIR> ftp://ilucky/MAT122
> 0 ftp://ilucky/nobytes
>
> v:\> pdir /(zac fpn) ftp://ilucky/???????
> <DIR> ftp://ilucky/MAT122
> -2 ftp://ilucky/nobytes
> ---------
> In both cases, the server responded with 0.

There is no way for PDIR (or anything else!) to determine the allocation
size on an ftp server. It's returning an error.

(And no, I don't think it's worthwhile cluttering things up further by
adding it to the help.)
 
May 20, 2008
11,400
99
Syracuse, NY, USA
On Sun, 11 Sep 2011 14:05:52 -0400, rconn <> wrote:

|---Quote---
|> And, the help says: "A question mark? matches any single filename
|> character" when in fact it seems to match 0 or 1 character (above, for
|> example). If that's WAD, the help should say so.
|---End Quote---
|That's not TCC, that's the file system you're using.
|
|In Windows, a ? matches a single character, or possibly no character if it's
|at the end of the filename. But it's too confusing to qualify that in the
|help by saying "depending on the OS, the file system, and where you've put
|the ? in the name."

And '?' doesn't match '.' (here anyway). Is that also FS dependent?
 
May 20, 2008
11,400
99
Syracuse, NY, USA
On Sun, 11 Sep 2011 14:18:42 -0400, rconn <> wrote:

|---End Quote---
|There is no way for PDIR (or anything else!) to determine the allocation
|size on an ftp server. It's returning an error.

Why no error for a non-empty file? Couldn't it just return the size as it does
for all other files? File size 0 ins't an error.

Code:
v:\> pdir /a-d /(zac fpn) ftp://ilucky/[in]*
        189,852 ftp://ilucky/ipv4.zip
             -2 ftp://ilucky/nobytes
 
May 20, 2008
3,515
4
Elkridge, MD, USA
|| And, the help says: "A question mark? matches any single filename
|| character" when in fact it seems to match 0 or 1 character (above,
|| for example). If that's WAD, the help should say so.
|
| That's not TCC, that's the file system you're using.
|
| In Windows, a ? matches a single character, or possibly no character if it's
| at the end of the filename. But it's too confusing to qualify that in the
| help by saying "depending on the OS, the file system, and where you've put
| the ? in the name."

TCC's wildcards are not an exact match to any file sytem I am familiar with, none of NTFS, FAT, POSIX, or VMS. Taking this into consideration, IMHO what TCC ought to do is to convert any file system access using TCC wildcards into one OR MORE file system accesses using the target file system's syntax, using its wildcard syntax if applicable. Barring this, there ought to be a more exact definition what it actually does, possibly as a "technical footnote".
--
Steve
 
May 20, 2008
11,400
99
Syracuse, NY, USA
On Sun, 11 Sep 2011 15:25:03 -0400, rconn <> wrote:

|---Quote---
|> Why no error for a non-empty file? Couldn't it just return the size as
|> it does for all other files? File size 0 ins't an error.
|---End Quote---
|You want it to silently return the wrong values?
|
|The issue is why it doesn't return -2 for files > 0.

Technically, yes. So I guess the question is ... when disk allocation is not
possible what would the user prefer to see, actual sizes or a bunch of "-2"s?
I'd opt for the sizes. OTOH a bunch of "-2"s would (after another discussion
like this) teach the user not to use 'a' when it's not appropriate.

A short parenthetical "when possible" in the help about the 'a' modifier could
clear it up a bit.
 
Similar threads
Thread starter Title Forum Replies Date
fpefpe How to? batch file size Support 2
Joe Caverly How to? Determine size of file via download link Support 13
B Downloading Updates - Error: Wrong file size?? Support 3
fpefpe zip command file size Support 1
G Wrong File Size Support 8
S CLIP file size limit Support 1
vefatica Updating v10: error wrong file size Support 2
J History file load hangs if file has complete garbage in it... Support 1
jdanielp Cannot step into and/or call another .bat file when debugging .bat file Support 2
thorntonpg file explorer - short cut keys Support 1
JohnQSmith New online help file wrong logo Support 7
Jay Sage WAD Possible Bug With OPTION Command With @FILE Support 5
samintz How to? swap endianness in a binary file Support 12
vefatica `Back quotes` - command line vs. batch file Support 5
Jay Sage Issues With TCMD File Explorer Support 0
FreezerBurnt Help making a CMD and TCC compatible batch file Support 7
Joe Caverly @FILESIZE and NTFS File Stream Support 1
Joe Caverly Embedding an .EXE (or other file) into a .BTM Support 8
U Command help on file names Support 5
S Concatenate all playlists into 1 file Support 22
Joe Caverly Set a batch variable (%1 - %n) when TCC is executing a batch file Support 5
Joe Caverly Rename file that begins with Emoji Support 7
Joe Caverly PSHELL and NTFS File Streams Support 2
P Kill all other instances of tcc from a btm batch file Support 2
D ffind hangs on large file Support 18
Alpengreis Documentation Minor issue in help file for view /E Support 1
fpefpe batch file ending early Support 18
J Licesne file location Support 1
K robocopy cancelling batch file processing Support 28
Jay Sage TCMD Crashes with "tctoolbar /c /r file" Support 5
A Unable to pass batch file arguments unaltered Support 18
MikeBaas How to...extract a string from a .json-file? Support 10
vefatica LIBRARY and file name completion? Support 4
D What does the file "..\Everything\Run history.csv" store? Support 5
H Takecommand.pdf failed not a pdf file Support 6
Joe Caverly DIRectory Colorization in v25 Help File Support 0
C show file description? with dir? Support 8
D When copying/moving, appending " (2)" to filename when the target file already exist. Support 7
R How to? Dir specific file search patterns with spaces in the pathnames? Support 6
Joe Caverly _EXPANSION in help file Support 0
Stefan Hassel Installation file TC 24.02 Build 47 is actually version 25.00.1 Support 10
vefatica Are @FILEDATE[file] and @FILEDATE[file,u] ever different? Support 2
K_Meinhard Help file error Support 1
Joe Caverly JOBMONITOR in Help File Support 1
D btm file command line augments comparing for string or math. Support 12
A Documentation [Help file] OPTION "//" synopsis formatting issue Support 0
vefatica Can TCC complete this file name? Support 5
G tcedit ist not run in tc 24 file explorer Support 10
M How to set Path variable for non-executable file extensions in 4DOS Support 8
I zip /M fails to delete file after adding to zip file Support 2

Similar threads