Disk (API)
From ComputerCraft Wiki
Revision as of 18:23, 21 April 2013 by Hawk777 (Talk | contribs) (Note local and remote side parameters and change incorrectly named function)
If you were looking for disks as in Floppies, go to Floppy Disk.
The Disk API allows you to interact with disk drives. These functions can operate on locally attached or remote disk drives. To use a locally attached drive, specify “side” as one of the six sides (e.g. “left”); to use a remote disk drive, specify its name as printed when enabling its modem (e.g. “drive_0”).
Method Name | Description |
disk.isPresent(string side) | Checks the given side for a disk |
disk.hasData(string side) | Checks whether the current disk is a floppy disk, as opposed to a music disk. |
disk.getMountPath(string side) | Returns the directory path on which the disk on side has been mount (ex. /disk) |
disk.setLabel(string side, string label) | Sets the label |
disk.getLabel(string side) | Finds label |
disk.getID(string side) | Finds ID (unique for every disk) |
disk.hasAudio(string side) | Checks whether the current disk is a music disk, as opposed to a floppy disk. |
disk.getAudioTitle(string side) | Returns the audio title on the disk |
disk.playAudio(string side) | Plays the audio |
disk.stopAudio(string side) | Stops the audio |
disk.eject(string side) | Ejects the disk. |