Difference between revisions of "Disk (API)"
From ComputerCraft Wiki
m |
(→Methods) |
||
Line 9: | Line 9: | ||
!style="background:#EEE" width="*"|Description | !style="background:#EEE" width="*"|Description | ||
|- | |- | ||
− | |[[disk.isPresent|isPresent]]([[string (type)|string]] side ) | + | |[[disk.isPresent|disk.isPresent]]([[string (type)|string]] side ) |
|Checks the given side for a disk | |Checks the given side for a disk | ||
|- | |- | ||
− | |[[disk.hasData|hasData]]([[string (type)|string]] side ) | + | |[[disk.hasData|disk.hasData]]([[string (type)|string]] side ) |
|Checks the disk for data | |Checks the disk for data | ||
|- | |- | ||
− | |[[disk.getMountPath|getMountPath]]([[string (type)|string]] side ) | + | |[[disk.getMountPath|disk.getMountPath]]([[string (type)|string]] side ) |
|Returns the directory path on which the disk on '''side''' has been mount (ex. /disk) | |Returns the directory path on which the disk on '''side''' has been mount (ex. /disk) | ||
|- | |- | ||
− | |[[disk.setLabel|setLabel]]([[string (type)|string]] side, [[string (type)|string]] label ) | + | |[[disk.setLabel|disk.setLabel]]([[string (type)|string]] side, [[string (type)|string]] label ) |
|Sets the label | |Sets the label | ||
|- | |- | ||
− | |[[disk.getLabel|getLabel]]([[string (type)|string]] side ) | + | |[[disk.getLabel|disk.getLabel]]([[string (type)|string]] side ) |
|Finds label | |Finds label | ||
|- | |- | ||
− | |[[disk.hasAudio|hasAudio]]([[string (type)|string]] side ) | + | |[[disk.hasAudio|disk.hasAudio]]([[string (type)|string]] side ) |
|Checks if the disk is a music disk | |Checks if the disk is a music disk | ||
|- | |- | ||
− | |[[disk.getAudioTitle|getAudioTitle]]([[string (type)|string]] side ) | + | |[[disk.getAudioTitle|disk.getAudioTitle]]([[string (type)|string]] side ) |
|Returns the audio title on the disk | |Returns the audio title on the disk | ||
|- | |- | ||
− | |[[disk.playAudio|playAudio]]([[string (type)|string]] side ) | + | |[[disk.playAudio|disk.playAudio]]([[string (type)|string]] side ) |
|Plays the audio | |Plays the audio | ||
|- | |- | ||
− | |[[disk.stopAudio|stopAudio]]([[string (type)|string]] side ) | + | |[[disk.stopAudio|disk.stopAudio]]([[string (type)|string]] side ) |
|Stops the audio | |Stops the audio | ||
|- | |- | ||
− | |[[disk.eject|eject]]([[string (type)|string]] side ) | + | |[[disk.eject|disk.eject]]([[string (type)|string]] side ) |
|Ejects the disk. | |Ejects the disk. | ||
|} | |} | ||
[[Category:APIs]] | [[Category:APIs]] |
Revision as of 03:39, 2 August 2012
If you were looking for disks as-in Floppies, go to Floppy Disk.
The Disk API allows you to mess around with disk drives.
Methods
Method name | Description |
---|---|
disk.isPresent(string side ) | Checks the given side for a disk |
disk.hasData(string side ) | Checks the disk for data |
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.hasAudio(string side ) | Checks if the disk is a music 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. |