Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Files /
Chapter 5 - Disk Initialization Manager / Disk Initialization Manager Reference
Routines / Low-Level Disk Initialization Routines


DIFormat

To format a disk, you can use the DIFormat function.

FUNCTION DIFormat (drvNum: Integer): OSErr;
drvNum
The number of the drive containing the disk to be formatted.
DESCRIPTION
The DIFormat function attempts to format the disk in the drive specified by the drvNum parameter and returns a result code indicating whether it completed the formatting successfully or failed. Formatting a disk consists of writing special information onto it
so that the disk driver can read from and write to the disk.

You can use DIFormat to format any unlocked disk, including single-sided disks, double-sided disks, high-density disks, and hard disk drives. It formats both sides
of a double-sided disk.

You have to unmount a disk before calling the DIFormat function.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for DIFormat are
Trap macroSelector
_Pack2$0006

SPECIAL CONSIDERATIONS
You should not call DIFormat at interrupt time.

RESULT CODES
noErr0No error
volOnLinErr-55Volume is online
lastDskErr-64Last of the range of low-level disk errors
...  
firstDskErr-84First of the range of low-level disk errors

Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996