fs.getDrive

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

Jump to: navigation, search


Grid Redstone.png  Function fs.getDrive
Returns the storage medium holding a path, or nil if the path does not exist. This is one of “hdd” if the path is stored on the computer’s local hard drive, “rom” if the path is in ROM, or the side on which a disk drive is attached if the path is on a Floppy Disk. As of ComputerCraft 1.52, a network-attached disk drive with a floppy in it returns the side of the computer on which the modem is attached, rather than the network name of the disk drive; presumably this is a bug.[1]
Syntax fs.getDrive(string path)
Returns string the type of storage medium holding the path, or nil if the path does not exist
Part of ComputerCraft
API fs

Examples

Grid paper.png  Example
Checks that the standard "startup" file is stored in ROM
Code
print(fs.getDrive("rom/startup"))
Output rom