docServerUserLandCom picture
Contents
Frontier Site

file.volumeBlockSize

Syntax file.volumeBlockSize (path)

Params path is the name of the volume whose block size you wish to determine.

Action Determines the allocation block size of the designated volume.

Returns The block size of the volume in bytes.

Examples file.volumeBlockSize ("C:\\")

   » 32768


file.volumeBlockSize ("System:") // an 80 megabyte hard disk

   » 2048

file.volumeBlockSize ("Dialog:") // an 800K floppy

   » 512

This script displays the size on disk of a data file:
f = "System:testfile";

filesize = file.size (f);

blocksize = file.volumeBlockSize (file.volumeFromPath (f));

return ((filesize + blocksize - 1) / blocksize * blocksize)


   » 6144

Errors Attempting to find out the allocation block size of a non-existent volume results in an error message.

Notes The allocation block size of a volume is the physical amount of space allocated to a file as it grows. A file containing 1 byte of data will occupy an entire block of disk space.

See Also file.freeSpaceOnVolume

file.volumeSize


© Copyright 1992-2026 UserLand Software. Email: webmaster@userland.com.