@FILESIZE[....,a] allocated size not matching Dir results

rps

Jul 6, 2008
436
6
What am I doing wrong?

Expected the @filesize allocated to be the same are that show in the dir command.

Code:
v23.00.25_$dir /a: /s /nfv /h /u2 *

    Total for:  C:\JPSoft\tcmd23x64\
         772,691,755 bytes in 167 files and 3 dirs    773,066,752 bytes allocated

v23.00.25_$echo %@filesize[/s,*,bc]
772,691,781

v23.00.25_$echo %@filesize[/s,*,bc,a]
1,545,740,288

v23.00.25_$echo %@files[/s /h,*,-d]
167

The allocated size parameter causes a error when used with a Network Attached Storage mapped drive. (Y: drive)
Code:
v23.00.25_$dir /a: /s /nfv /h /u2 Y:\*

    Total for:  Y:\
         553,641,430 bytes in 6 files and 2 dirs    553,644,032 bytes allocated

v23.00.25_$echo %@files[/s,/h,Y:\*,-d]
6

v23.00.25_$echo %@filesize[/s,Y:\*,bc]
553,641,430

v23.00.25_$echo %@filesize[/s,Y:\*,bc,a]
TCC: (Sys) An unexpected network error occurred.
 "Y:\#recycle\*"
1,107,296,256
I know about the @FILESIZE[] warning regarding network drives, but did not expect an error.
Is there any way to prevent this error and get some type of allocation size info?
 
May 20, 2008
11,546
104
Syracuse, NY, USA
Same here. H:\work is a local directory. @FILESIZE reports about twice what DIR reports.

Code:
v:\> dir /a: /u2 h:\work\*

Volume in drive H is DATA         Serial number is c007:d3e4
         154,638,655 bytes in 115 files and 5 dirs    155,021,312 bytes allocated
       6,753,193,984 bytes free

v:\> echo %@filesize[h:\work\*,bc,a]
309,620,736

They match perfectly in versions 16 and 21. In version 22 @FILESIZE reports a bit less.
Code:
v:\> dir /a: /u2 h:\work\*

 Volume in drive H is DATA         Serial number is c007:d3e4
         154,638,655 bytes in 115 files and 5 dirs    155,021,312 bytes allocated
       6,753,193,984 bytes free

v:\> echo %@filesize[h:\work\*,bc,a]
154,638,655
 

rps

Jul 6, 2008
436
6
Vince,

Yep; both V22 and V23 have problems with @filesize[]
I had another thread back in July with the same subject, so I just posted an example of the subject in that older thread.
I didn't remember when I started this as a new thread. I will wait for Rexx to respond to my latest post in the older thread.

Hopefully the error when using the network drive will be fixed along with the other issues.
 

rconn

Administrator
Staff member
May 14, 2008
12,406
152
I know about the @FILESIZE[] warning regarding network drives, but did not expect an error.
Is there any way to prevent this error and get some type of allocation size info?

That's up to Microsoft - there currently isn't any way in Windows to retrieve allocation size info for network drives. TCC guesses but there's no guarantee it's right.
 

rps

Jul 6, 2008
436
6
That's up to Microsoft - there currently isn't any way in Windows to retrieve allocation size info for network drives. TCC guesses but there's no guarantee it's right.
Understood. Thanks for the information.
Does this mean that the allocation size displayed by DIR isn't accurate?
Sure would be nice if MS would enter the 21st century. After all networking has been around for several decades. :cool:
 

rconn

Administrator
Staff member
May 14, 2008
12,406
152
Understood. Thanks for the information.
Does this mean that the allocation size displayed by DIR isn't accurate?
Sure would be nice if MS would enter the 21st century. After all networking has been around for several decades. :cool:

Correct, the allocation size displayed by DIR is not going to be accurate (unless the network drive is NTFS).

It's not entirely Microsoft's fault -- the network redirector (the NAS software) isn't providing that information. (Granted, 99.9% of the users don't care about allocation size.)
 
Feb 14, 2020
4
0
Earth. Usually.
I'm currently having a problem getting FILESIZE to return sensible "allocated space" results from a few of the files on my hard drive. I've just registered with this forum and I'm now searching to see if anyone has had the same problem as me.

I see from post #1 by rps that they have found this FILESIZE bug. Unfortunately the thread then gets bogged down in a discussion about network drives. But the original example shows an incorrect result being returned for a local directory.

Please see my test results below. Will this bug be addressed at some point?

Thanks for any help given.

(Edit: Perhaps I should confirm that I'm using TCC/LE 14.00.9 X64 on Win10 Home 1903.)

Code:
D:\Temp2>dir

Volume in drive D is FastDisk       Serial number is 484d:d58f
Directory of  D:\Temp2\*

07/02/2020  20:28  31,723,810,198  Content.ggpk
    31,723,810,198 bytes in 1 file and 0 dirs    31,723,810,816 bytes allocated
    19,700,711,424 bytes free

D:\Temp2>echo %@filesize["content.ggpk",bc]
31,723,810,198

D:\Temp2>echo %@filesize["content.ggpk",bc,a]
1,659,039,744

D:\Temp2>
 
Last edited:
Similar threads
Thread starter Title Forum Replies Date
vefatica @FILESIZE[] ... allocated ... unexpected results Support 0
rps Fixed @filesize[...,a] space allocated values incorrect Support 2
vefatica @FILESIZE ... allocated space Support 7
Joe Caverly @FILESIZE and NTFS File Stream Support 1
M @Files and @FileSize failures... Support 2
M @FileSize - How is this possible? Support 10
M @Files, @FileSize returning nothing... Support 7
M A (minor) limitation of @FileSize... Support 6
JohnQSmith WAD Incorrect results from @FILESIZE Support 9
H @filesize result for directory? Support 2
dcantor Build 56 @FILESIZE problem Support 2
R Fixed Bytes Allocated Total Incorrect in V17 b52 Support 1
M How to? Find out the total allocated size of a directory tree... Support 7
R History window wrong size, can't remember size change Support 12
fpefpe How to? batch file size Support 2
vefatica Documentation Documentation of popup location and size Support 4
S Increasing Font Point Size in Command Tabs Support 2
S How to? What's the maximum size of the thread text ? Support 5
ntak About window size notification Support 6
Joe Caverly Windows Size is 80x0 Support 2
D Need to set Take Command font size when switching to high DPI display Support 0
D Range command dialog with blank maximum size erases everything Support 5
R How to? Change TCMD tab font size in window menu Support 3
D Get tab position and size Support 6
Alpengreis The TCMD Display problems and font size ... Support 2
Joe Caverly How to? Determine size of file via download link Support 13
C VIEW PRINT - Documentation corrected - Font size Support 8
L alternate streams size not counted Support 7
C Screens of different size and hidden console Support 8
mikea How to? @select[] window size, redux. Support 3
Joe Caverly Window Size (Columns x Rows) Support 2
N Popup Window size too small Support 5
Mordachai how to control window size? Support 10
Joe Caverly New Tab In TCMD Changes TCC Window Size Support 1
R WAD /= size ranges not set correctly Support 5
fpefpe How to? Fonts / Size in console window Support 5
C TCC scrollback buffer size Support 11
C Size of keystack buffer? Support 2
B Downloading Updates - Error: Wrong file size?? Support 3
C CMD window size and post_exec alias ? Support 6
S How to? Command dialogs vs. size/date/etc. exclusion ranges Support 1
T @ping: response code, data size and documentation incorrect Support 2
vefatica File size = -2? Support 8
vefatica FFIND and size ranges Support 1
fpefpe zip command file size Support 1
G Wrong File Size Support 8
davidebbo History popups doesn't remember its position/size Support 4
S DIR - summary of size of subdirectories??? Support 13
S CLIP file size limit Support 1
S Conditionally MOVE/COPY files on the basis of size Support 1

Similar threads