Difference between revisions of "Disk (API)"
From ComputerCraft Wiki
Scarfacial (Talk | contribs) |
|||
Line 8: | Line 8: | ||
!style="background:#EEE" width="*"|Description | !style="background:#EEE" width="*"|Description | ||
|- | |- | ||
− | |disk.isPresent( side ) | + | |[[disk.isPresent|isPresent]]( side ) |
|Checks the given side for a disk | |Checks the given side for a disk | ||
|- | |- | ||
− | |disk.hasData( side ) | + | |[[disk.hasData|hasData]]([[string]] side ) |
|Checks the disk for data | |Checks the disk for data | ||
|- | |- | ||
− | |disk.getMountPath( side ) | + | |[[disk.getMountPath|getMountPath]]([[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( side ) | + | |[[disk.setLabel|setLabel]]([[string]] side ) |
|Sets the label | |Sets the label | ||
|- | |- | ||
− | |disk.getLabel( side ) | + | |[[disk.getLabel|getLabel]]([[string]] side ) |
|Finds label | |Finds label | ||
|- | |- | ||
− | |disk.hasAudio( side ) | + | |[[disk.hasAudio|hasAudio]]([[string]] side ) |
|Checks if the disk is a music disk | |Checks if the disk is a music disk | ||
|- | |- | ||
− | |disk.playAudio( side ) | + | |[[disk.playAudio|playAudio]]([[string]] side ) |
|Plays the audio | |Plays the audio | ||
|- | |- | ||
− | |disk.stopAudio( side ) | + | |[[disk.stopAudio|stopAudio]]([[string]] side ) |
|Stops the audio | |Stops the audio | ||
|- | |- | ||
− | |disk.eject( side ) | + | |[[disk.eject|eject]]([[string]] side ) |
|Ejects the disk. | |Ejects the disk. | ||
|} | |} | ||
[[Category:APIs]] | [[Category:APIs]] |
Revision as of 11:37, 26 February 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.
Method name | Description |
---|---|
isPresent( side ) | Checks the given side for a disk |
hasData(string side ) | Checks the disk for data |
getMountPath(string side ) | Returns the directory path on which the disk on side has been mount (ex. /disk) |
setLabel(string side ) | Sets the label |
getLabel(string side ) | Finds label |
hasAudio(string side ) | Checks if the disk is a music disk |
playAudio(string side ) | Plays the audio |
stopAudio(string side ) | Stops the audio |
eject(string side ) | Ejects the disk. |