Help with File Size Calculations

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Help with File Size Calculations

#16 Post by foxidrive » 14 Jan 2014 12:27

Aacini wrote:

Code: Select all

C:\> geq 12345678901234567 12345678901234569
12345678901234567-12345678901234569
yes


Antonio


That's a 12 petabyte disk array and a 12 petabyte file, isn't it? :D

Aacini
Expert
Posts: 1913
Joined: 06 Dec 2011 22:15
Location: México City, México
Contact:

Re: Help with File Size Calculations

#17 Post by Aacini » 14 Jan 2014 13:21

foxidrive wrote:
Aacini wrote:

Code: Select all

C:\> geq 12345678901234567 12345678901234569
12345678901234567-12345678901234569
yes


Antonio


That's a 12 petabyte disk array and a 12 petabyte file, isn't it? :D

I just say that my first solution was entirely based on the original request:
julesverne wrote:Hi all, I found this cool bat code to parse out larger than 32 byte numbers. http://ss64.org/viewtopic.php?id=288#p884

It takes a file size number like.. 999999999999999999999999999999 and turns it in TB GB MB KB B

What I'd like to do is take any file, no matter what size. have it give me the size output using the script the link has. Then take the total disk space available on a drive using the above method. Then.. subtract the file size output from the total diskspace output to see if it has enough free space to copy...

Jules

By the way: :mrgreen:

Code: Select all

C:\> DecimalToPowerOf1024.bat 999999999999999999999999999999
PowerOf1024=9
PowerOf1024[0]=1023
PowerOf1024[1]=1023
PowerOf1024[2]=1023
PowerOf1024[3]=936
PowerOf1024[4]=237
PowerOf1024[5]=413
PowerOf1024[6]=260
PowerOf1024[7]=627
PowerOf1024[8]=812
PowerOf1024[9]=807

Antonio

Post Reply