fs.getDrive

From ComputerCraft Wiki
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. From ComputerCraft 1.52 through ComputerCraft 1.64, 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; this was 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
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox