Class Burn::Drive

Abstract

This class references a physical drive in the system.

Inherits from: Object ← Burn::Drive .

Included in: Burn .

Index: STATUS_ERASING STATUS_GRABBING STATUS_IDLE STATUS_READING STATUS_SPAWNING STATUS_WRITING STATUS_WRITING_LEADIN STATUS_WRITING_LEADOUT buffer_size can_read_cdr? can_read_cdrw? can_read_dvdr? can_read_dvdram? can_read_dvdrom? can_report_c2_errors? can_write_cdr? can_write_cdrw? can_write_dvdr? can_write_dvdram? can_write_simulate? cancel! disc disc_erasable? disc_status erase_disc! grab! location packet_block_types product progress raw_block_types read_speed release! sao_block_types scan set_speed status tao_block_types vendor write_speed

Class methods
scanscan
 

Scans for drives.

# Example: prints name and location of all drives 
Burn::Drive.scan.each do |drive|
	puts drive.product + " on " + drive.location
end
 
  • Returns: a list of drives (cdroms/burners), as an Array of Burn::Drive objects.

Instance methods
buffer_sizebuffer_size
 
  • Returns: the size of the drive's buffer (in kilobytes).

can_read_cdr?can_read_cdr?
 
  • Returns: whether the drive can read CD-R discs.

can_read_cdrw?can_read_cdrw?
 
  • Returns: whether the drive can read CD-RW discs.

can_read_dvdr?can_read_dvdr?
 
  • Returns: whether the drive can read DVD-R discs.

can_read_dvdram?can_read_dvdram?
 
  • Returns: whether the drive can read DVD-RAM discs.

can_read_dvdrom?can_read_dvdrom?
 
  • Returns: whether the drive can read DVD-ROM discs.

can_report_c2_errors?can_report_c2_errors?
 
  • Returns: whether the drive can report C2 errors.

can_write_cdr?can_write_cdr?
 
  • Returns: whether the drive can write CD-R discs.

can_write_cdrw?can_write_cdrw?
 
  • Returns: whether the drive can write CD-RW discs.

can_write_dvdr?can_write_dvdr?
 
  • Returns: whether the drive can write DVD-R discs.

can_write_dvdram?can_write_dvdram?
 
  • Returns: whether the drive can write DVD-RAM discs.

can_write_simulate?can_write_simulate?
 
  • Returns: whether the drive can simulate a write.

cancel!cancel!
 

Cancels an operation on a drive. This will only work when the drive's busy state is Burn::Drive::STATUS_READING or Burn::Drive::STATUS_WRITING.

  • Returns: self.

discdisc
 
  • Returns: the drive's disc, as a newly allocated Burn::Disc object.

disc_erasable?disc_erasable?
 

Checks whether a disc can be erased or not.

  • Returns: true if erasable, false if not.

disc_statusdisc_status
 

Retrieves what kind of disc a drive is holding. This method may need to be called more than once to get a proper status from it.

erase_disc!erase_disc!(fast)
 

Erases a disc in the drive. The drive must be grabbed successfully BEFORE calling this method. Always ensure that the drive reports a status of Burn::Disc::STATUS_FULL before calling this function. An erase operation is not cancellable, as control of the operation is passed wholly to the drive and there is no way to interrupt it safely.

  • fast: true to do a fast erase, where only the disc's headers are erased; false to erase the entire disc.

  • Returns: self.

grab!grab!(load)
 

Grabs a drive. This must be done before the drive can be used (for reading, writing, etc). It may be neccesary to call this method more than once to grab a drive.

  • load: true to make the drive attempt to load a disc (close its tray door, etc).

  • Returns: true is the drive has been grabbed, false otherwise.

locationlocation
 
  • Returns: the location of the drive in the filesystem.

packet_block_typespacket_block_types
 
productproduct
 
  • Returns: the name of the drive.

progressprogress
 
  • Returns: the progres of the current operation on the drive, as a newly allocated Burn::Progress object.

raw_block_typesraw_block_types
 
read_speedread_speed
 
  • Returns: maximum read speed for a drive in k/s.

release!release!(eject)
 

Releases a drive. This should not be done until the drive is no longer busy (see Burn::Drive#status).

  • eject: true to make the drive eject the disc in it.

  • Returns: self.

sao_block_typessao_block_types
 
set_speedset_speed(read, write)
 

Sets drive read and write speed.

  • read: read speed in k/s (0 is max).

  • write: write speed in k/s (0 is max).

  • Returns: self.

statusstatus
 

Gets the status of the drive.

tao_block_typestao_block_types
 
vendorvendor
 
  • Returns: the name of the vendor of the drive.

write_speedwrite_speed
 
  • Returns: maximum write speed for a drive in k/s.

Constants
STATUS_ERASING

The drive is erasing a disc.

STATUS_GRABBING

The drive is being grabbed.

STATUS_IDLE

The drive is not in an operation.

STATUS_READING

The drive is reading data from a disc.

STATUS_SPAWNING

The library is spawning the processes to handle a pending operation (A read/write/etc is about to start but hasn't quite yet)

STATUS_WRITING

The drive is writing data to a disc.

STATUS_WRITING_LEADIN

The drive is writing Lead-In.

STATUS_WRITING_LEADOUT

The drive is writing Lead-Out.