Difference between revisions of "Fs.getFreeSpace"

From ComputerCraft Wiki
Jump to: navigation, search
(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=[[String_(type)|string]] path
+
|args={{Type|string}} path
 
|api=fs
 
|api=fs
|returns=[[int_(type)|integer]] value of the amount of free space in the requested location, in bytes
+
|returns={{Type|int}} free space in bytes
|desc=Returns the amount of free space in the given directory, which may refer to the computer’s local hard drive or to a floppy disk.
+
|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


Grid Redstone.png  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

Grid paper.png  Example
Computes the amount of free space on the computer
Code
print(tostring(fs.getFreeSpace("/")))
Output 10(can be different)