fs.getSize

From ComputerCraft Wiki
Revision as of 13:56, 18 July 2013 by Cranium (Talk | contribs) (Changing int to number)

Jump to: navigation, search


Grid Redstone.png  Function fs.getSize
Gets the size of a file in bytes. This is not actually the exactly length of the file in bytes; rather, it is the amount that the file contributes towards the computer’s or disk’s storage quota. This is either 512 bytes or the actual length of the file plus the length of its name, whichever is larger.[1] ComputerCraft will show that any file smaller than 512 bytes as 512 bytes.
Syntax fs.getSize(string path)
Returns number size in bytes
Part of ComputerCraft
API fs

Examples

Grid paper.png  Example
Get the size of the shell from the ROM and print it
Code
print( fs.getSize("/rom/programs/shell") )