Difference between revisions of "Fs.getFreeSpace"
From ComputerCraft Wiki
(Fix return value; clarify possible targets) |
(Copy description from API page, clean up return, and use type template) |
||
Line 2: | Line 2: | ||
{{Function | {{Function | ||
|name=fs.getFreeSpace | |name=fs.getFreeSpace | ||
− | |args= | + | |args={{Type|string}} path |
|api=fs | |api=fs | ||
− | |returns= | + | |returns={{Type|int}} free space in bytes |
− | |desc= | + | |desc=Gets the remaining space in the given directory. The directory may refer to the computer’s local hard drive or to a floppy disk. |
|examples= | |examples= | ||
{{Example | {{Example | ||
Line 13: | Line 13: | ||
}} | }} | ||
}} | }} | ||
+ | |||
[[Category:Lua_Core_Functions]] | [[Category:Lua_Core_Functions]] |
Revision as of 19:43, 22 April 2013
Function fs.getFreeSpace | |
Gets the remaining space in the given directory. The directory may refer to the computer’s local hard drive or to a floppy disk. | |
Syntax | fs.getFreeSpace(string path) |
Returns | int free space in bytes |
Part of | ComputerCraft |
API | fs |
Examples
Example | |
Computes the amount of free space on the computer | |
Code |
print(tostring(fs.getFreeSpace("/"))) |
Output | 10(can be different) |