fs.getSize

From ComputerCraft Wiki
Revision as of 19:43, 22 April 2013 by Hawk777 (Talk | contribs) (Change description and use type template)

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]
Syntax fs.getSize(string path)
Returns int 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") )