Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: disk free diskfree allocation size space file
If you run a DiskFree on a new disk, it returns the space on the disk. If you move some files over and subtract their size from the original disk space, the sum will not necessarily be what DiskFree returns after the files have been moved.
Files are allocated a certain amount of space regardless of their size. For example, if you have a ream of paper, which is 500 sheets, and you write 2 letters, one letter is 1-1/2 pages and the other page is 1/2 a page. You may think that you have 498 pages remaining, when in fact you have 497 pages remaining. If you write on 1/2 a page, you have still used one page.
So you need to figure out the size of the file and then bump it up to the next allocation size. Then add up the allocation sizes of all the files to get the correct amount.
In the 16 bit environment, I am doing an addextender of "wwwn16i.dll" and using "wnaddcon" and "wncancelcon" to connect and disconnect. Diskfree never reports more than 2,147,483,647 free, even though the server connected to has more than 8Gb free. In general I need to be able to handle numbers into the 100+Gb range.
In the 32 bit environment, I am doing an addextender of "wwnet34I.dll" and using "netadddrive" and "netcancelcon" to connect and disconnect. Diskfree is never called, because I don't get a connection.
The number you are getting is the largest positive number that will fit into our integer variables (32 bit signed).
I checked with the current version 96G and when the diskfree space gets larger than that, we move into floating point mode. But in 5.1C, I don't exactly remember how diskfree operated. So one of the two items below is occurring:
aaa=DiskFree("C: C: C: C: C: C: C: C: C: C: C: C: C: C: C: C: C: C: C: C: C:") Message("C: etc",aaa)
In this example we just check the freespace on the C: drive a lot. Hopefully there is a lot of free space on it and the number will get large. The idea is to see if it moves into floating point land or not.
I've written a simple script:
sz = Diskfree("c") Display(5, "Size", "The size of your drive is: %sz% MB)The size of the drive appears in bytes, ie. 678260736 btyes but I want it to appear as 678 MB. How do you do conversion?
MB=1024*1024 sz = Diskfree("c") szmb= Int(sz / MB)Display(5, "Size", "The size of your drive is: %szmb% MB)
Article ID: W13052
Filename: DiskFree Function.txt
File Created: 2001:03:01:14:41:36
Last Updated: 2001:03:01:14:41:36