fs.getDrive
From ComputerCraft Wiki
Revision as of 19:08, 21 April 2013 by Hawk777 (Talk | contribs) (More possible return values related to floppies)
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 |
Part of | ComputerCraft |
API | fs |
Examples
Example | |
Checks that the standard "startup" file is stored in ROM | |
Code |
print(fs.getDrive("rom/startup")) |
Output | rom |