Difference between revisions of "Disk (API)"

From ComputerCraft Wiki
Jump to: navigation, search
(Methods)
(added disk.getDiskID function)
Line 23: Line 23:
 
|[[disk.getLabel|disk.getLabel]]([[string (type)|string]] side )
 
|[[disk.getLabel|disk.getLabel]]([[string (type)|string]] side )
 
|Finds label
 
|Finds label
 +
|-
 +
|-
 +
|[[disk.getDiskID|disk.getDiskID]]([[string (type)|string]] side )
 +
|Finds ID (unique for every disk)
 
|-
 
|-
 
|[[disk.hasAudio|disk.hasAudio]]([[string (type)|string]] side )
 
|[[disk.hasAudio|disk.hasAudio]]([[string (type)|string]] side )

Revision as of 22:34, 12 September 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.getDiskID(string side ) Finds ID (unique for every disk)
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.