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

rps

Jul 6, 2008
378
4
#1
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?
 
#2
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
378
4
#3
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
10,764
97
#4
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
378
4
#5
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
10,764
97
#6
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.)