Difference between revisions of "Fs.getFreeSpace"

From ComputerCraft Wiki
Jump to: navigation, search
(Copy description from API page, clean up return, and use type template)
m
 
(One intermediate revision by one other user not shown)
Line 4: Line 4:
 
|args={{Type|string}} path
 
|args={{Type|string}} path
 
|api=fs
 
|api=fs
|returns={{Type|int}} free space in bytes
+
|returns={{Type|number}} free space in bytes
 
|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.
 
|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
|desc=Computes the amount of free space on the computer
+
|desc=Prints the amount of free space on the computer.
|code=print(tostring(fs.getFreeSpace("/")))
+
|code=print('''fs.getFreeSpace("/")''')
|output=10(can be different)
+
|output=Depends on your in-game computer's storage.
 
}}
 
}}
 
}}
 
}}
  
 
[[Category:Lua_Core_Functions]]
 
[[Category:Lua_Core_Functions]]

Latest revision as of 16:29, 10 April 2014


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 number free space in bytes
Part of ComputerCraft
API fs

Examples

Grid paper.png  Example
Prints the amount of free space on the computer.
Code
print(fs.getFreeSpace("/"))
Output Depends on your in-game computer's storage.