GS/OS ProDOS 8 Purpose: To tell GS/OS to begin deferring all disk write operations that involve updating volume bit map and directory blocks. There is no equivalent ProDOS 8 command. Parameter table: GS/OS Input or bet Symbolic Name Result +0to +1 pcount I Descriptions of parameters: Description Number of parameters (0) pcount The number of parameters in the GS/OS parameter table. The min- imum value is 0; the maximum is 0. Common error codes: [none] Comments: Write-deferral sessions are useful where your application wants to transfer a group of files from one disk to another as quickly as possible. If you don't use a write-deferral session, copying operations slow down because the disk read/write head must sweep across the disk medium to access volume bit map and directory blocks before and after each file transfer. (These blocks are usually physically located far from the file's data blocks.) By preventing these time-consuming head movements, you will maximize performance. At the end of the copying operation, use the EndSession command to write to disk the blocks that were cached during the session. You must always balance every BeginSes- sion call with an EndSession call. 92 GS/OS and ProDOS 8 Commands BindInt $2031 GS/OS ProDOS 8 Purpose: To assign a GS/OS interrupt-handling subroutine to a particular interrupt source. Under ProDOS 8, use the ALLOC - INTERRUPT command instead. Parameter table: GS/OS Input or C))Cset Symbolic Name Result +0 to + 1 pcount I +2 to +3 int~num R +4 to +5 vrn I +6to +9 intcode I Descriptions of parameters: Description Number of parameters (3) Interrupt reference number Vector reference number Pointer to interrupt handler pcount The number of parameters in the GS/OS parameter table. The min- imum value is 3; the maximum is 3. int - num The reference number GS/OS assigns to the interrupt-handling sub- routine. Use this number when you remove the subroutine with the UnbindInt command. vrn A reference number that identifies the type of system interrupt the interrupt handler is to be assigned to: $0008 AppleTalk (SCC) $0009 Serial ports (SCC) $000A Scan-line retrace $000B Ensoniq waveform completion $000C Vertical blanking signal (VBL) $000D Mouse (movement or button) $000E 1/4-second timer $000F Keyboard $0010 ADB response byte ready $0011 ADB service request (SRQ) $0012 Desk accessory request keystroke $0013 Flush keyboard buffer request keystroke $0014 Keyboard micro abort $0015 1-second timer Command Descriptions 93 $0016 Video Graphics Controller (external) $0017 Other interrupt source (SCC is the Serial Communications Controller; ADB is the Apple Desktop Bus.) If the interrupt emanates from a source that does not have a specific vrn, set vrn = $0017. int - code A pointer to the beginning of the interrupt-handling subroutine. See Chapter 8 for a discussion of rules and conventions GS/OS interrupt- handling subroutines must follow. Important: Install an interrupt-handling subroutine before enabling interrupts on the hardware device. If you don't, the system will crash if an interrupt occurs before you've had a chance to install the handler. Common error codes: $25 The interrupt vector table is full. Solution: Remove one of the active interrupt-handling subroutines (using UnbindInt) and try again. Other possible error codes are $04, $07, $53. Comments: See chapter 6 for a discussion of how to handle interrupts in a GS/OS environment. 94 GS/OS and ProDOS 8 Commands ChangePath $2004 GS/OS ProDOS 8 Purpose: To rename a file or a disk volume or to move a file from one directory to another on the same disk volume. You can change the path of any closed file whose rename-- enabled access code bit is set to 1. Under ProDOS 8, use the RENAME command to rename a file or disk volume. There is no command for moving a file between two directories. Parameter table: GS/OS Input or C))Cset Symbolic Name Result +0to +1 pcount I +2to +5 pathname I +6to +9 newpathname I Descriptions of parameters: Description Number of parameters (2) Pointer to the pathname string Pointer to the new pathname string pcount The number of parameters in the GS/OS parameter table. The min- imum value is 2; the maximum is 2. pathname A pointer to a class 1 GS/OS string describing the current pathname of the file whose path is to be changed. If the pathname specified is not preceded by a separator (/or:), the operating system appends the name to the default prefix (the 0/ prefix) to create a full pathname. newpathname A pointer to a class 1 GS/OS string describing the new pathname of the file whose path is to be changed. If the pathname specified is not preceded by a separator (/or :), the operating system appends the name to the default prefix (the 0/ prefix) to create a full pathname. Common error codes: $2B The disk is write-protected. $40 The pathname contains invalid characters, or a full pathname was not specified (and no default prefix has been set up). Verify that the filenames and directory names specified in the pathname adhere to the naming rules described in Chapter 2 and, if a partial pathname was specified, that a default prefix has been set up. Command Descriptions 95 $44 A directory in the pathname was not found. Solution: Double-check the spelling of the pathname, insert the disk containing the correct directory, or change the default prefix. $45 The volume directory was not found. $46 The file was not found. $47 The new pathname specified already exists. Solution: Give the file a new pathname not used by any other file on the disk volume. $4E The file cannot be accessed. Solution: Set the rename-enabled bit of the file's access code to 1 using SetFileInfo. $50 The file is open. ChangePath works with closed files only. $5B The two pathnames indicate different volumes. You can use Change- Path only for moving files within a single volume. Other possible error codes are $07, $27, $4A, $4B, $52, $57, $58. Programming example: Suppose you want to move a file called MY.ACCESSORY from a subdirectory called ASM: on the boot disk to the desk accessory directory on the boot disk. Here is the code you would use: _ChangePath CP_Parms RTS CP_Parms ANOP DC I2'2' ;The number of parameters DC I4'Curr_Name' DC I4'New_Name' Curr_Name GSString '*:ASM:MY.ACCESSORY' New_Name GSString '*:SYSTEM:DESK.ACCS:MY.ACCESSORY' Note that when ChangePath moves a file from one subdirectory to another on the same disk, it moves only the file's subdirectory entry. The file's data stays put since the new subdirectory entry for the file still points to it. When the two paths specified describe files in the same subdirectory, ChangePath is equivalent to the ProDOS 8 RENAME command. Note also that there are restrictions to keep in mind when moving a subdirectory into another subdirectory. The subdirectory you're moving cannot be part of the pathname for the target subdirectory. 96 GS/OS and ProDOS 8 Commands