Welcome!

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

SignUp Now!

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

Jul
441
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?
 
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
 
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.
 
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.
 
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:
 
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.)
 
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:
Oops! I was searching through so many posts about the FILESIZE function, I forgot to go back to the TCC/LE section when I finished. Apologies.
 

Similar threads

Back
Top