Component/drive

From OpenComputers: Rebooted
Revision as of 08:08, 24 August 2026 by imported>OCDoc Import (Imported from legacy OpenComputers documentation at ocdoc.cil.li)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Component: Drive

This component is provided by Floppy Disks or Hard Disk Drives in Unmanaged mode (for Managed mode, see Filesystem)

To switch a managed drive to Unmanaged mode, just right click with the item in your hand and select Unmanaged mode (Warning: this will wipe the drive).

Component name: `drive`. Callbacks:

  • `readByte(offset:number):number`
Read a single byte at the specified offset.
  • `writeByte(offset:number, value:number)`
Write a single byte to the specified offset.
  • `getSectorSize():number`
Returns the size of a single sector on the drive, in bytes.
  • `getLabel():string`
Get the current label of the drive.
  • `setLabel(value:string):string`
Sets the label of the drive. Returns the new value, which may be truncated.
  • `readSector(sector:number):string`
Read the current contents of the specified sector.
  • `writeSector(sector:number, value:string)`
Write the specified contents to the specified sector.
  • `getPlatterCount():number`
Returns the number of platters in the drive.
  • `getCapacity():number`
Returns the total capacity of the drive, in bytes.

Components Category Documentation
Components Core Components 3D Printer - Abstract Bus - Access Point - Chunkloader - Computer - Crafting - Data Card - Database - Debug - Drone - Drive - EEPROM - Experience - Filesystem - Generator - Geolyzer - GPU - Hologram - Internet - Inventory Controller - Leash - Microcontroller - Modem - Motion Sensor - Navigation - Net Splitter - Piston - Redstone - Redstone in Motion - Robot - Screen - Sign - Tank Controller - Tractor Beam - Transposer - Tunnel - World Sensor
Others Component Access - Signals
Cross-Mod Integration Applied Energistics