Type ASSEMBLE
Source Lines : 685
Fixes Applied : 3
Most Recent Version : Tuesday, December 12, 1978
Last Fix ID : [HRC015DS]
Module
DMSRNM (RENAME)
Function
RENAME COMMAND. CHANGES THE FILEID OF THE SPECIFIED FILE.
Attributes
TRANSIENT
Operation
RENAME CHECKS THE PARAMETER LIST FOR VARIOUS TYPES OF ERRORS, AND GIVES ERROR RETURNS, WITH MESSAGES, FOR ANY ERROR DETECTED. ONLY READ-WRITE DISK(S) ARE CHECKED FOR THE FILES SPECIFIED; READ-ONLY DISKS ARE IGNORED. WHEN THE PARAMETER LIST HAS BENN CHECKED AND APPROPRIATE FLAG-BITS SET AS NEEDED, RENAME CHECKS FOR EXISTENCE OF THE GIVEN FILE(S), AND CHANGES THE FILE IDENTIFICATION, AS FOLLOWS: 1. ACTLKP IS CALLED TO CHECK IF THE FILE TO BE CHANGED HAPPENS TO BE ACTIVE - THAT IS, IN THE ACTIVE FILE TABLE. THIS IS TREATED AS AN ERROR. IN A COUPLE OF CASES WHERE THIS ERROR HAS BEEN KNOWN TO OCCUR, THE CALLING PROGRAM EITHER FORGOT TO CLOSE THE FILE BEFORE CHANGING IT, OR TRIED TO RENAME IT FIRST AND CLOSE IT AFTERWARDS. THUS, IF THIS ERROR SHOULD OCCUR (A MESSAGE IS TYPED TO WARN THE USER), LOOK FOR THIS TYPE OF BUG IN THE CALLING PROGRAM. 2. IF THE GIVEN FILE IS NOT IN THE ACTIVE FILE TABLE, RENAME CHECKS FOR THE FILE BY A CALL TO FSTLKW. IF NOT FOUND, RENAME EXITS WITH A NORMAL RETURN IF AT LEAST ONE FFILE WAS CHANGED, OR WITH AN ERROR (WITH MESSAGE) IF NO FILES AT ALL WERE CHANGED. 3. IF THE GIVEN FILE WAS FOUND BY FSTLKW, A CHECK IS MADE TO ENSURE THAT THE FILE IDENTIFIED BY THE NEW NAME AND TYPE DOES NOT ALREADY EXIST IN THE ACTIVE FILE TABLE FOR THE SAME DISK (VIA ACTLKP CALL - RETURN CODE 8 IF FOUND), OR IN THE FST TABLES FOR THE SAME DISK (VIA FSTLKW). IF IT IS FOUND, AN ERROR IS RETURNED BY RENAME. 4. IF NOT, THE FILE IDENTIFICATION IS ALTERED AS SPECIFIED BY THE CALLER'S PARAMETER LIST, AND A FLAG-BIT IS SET IF A CHANGE WAS ACTUALLY MADE (FOR THE SUBSEQUENT EXIT AS DESCRIBED ABOVE IN STEP 2). 5. RENAME THEN CHECKS THE NOUPDIRT FLAG BIT OF ALTRFLG TO DETERMINE IF THAT OPTION - TO PROHIBIT THE UPDATING OF THE FILE DIRECTORY - WAS SPECIFIED. IF SO, THE FLAG BIT USED TO SIGNAL THAT THE FILE DIRECTORY IS TO BE UPDATED VIA A CALL TO UPDISK IS NOT TURNED ON. 6. RENAME THEN CHECKS THE FLAG BIT IN ALTRFLG TO DETERMINE IF THE TYPE OPTION - TO TYPE THE IDENTIFIER(S) OF THE FILE(S) ALTERED TO THE CONSOLE - WAS SPECIFIED. IF TYPE WAS SPECIFIED, THE PLIST IS SET UP, AND A CALL TO CONWRITE TYPES THE IDENTIFIER OF THE FILE. 7. THEN A CALL TO THE TFINIS ROUTINE IS MADE (IF NECESSARY) TO TEMPORARILY CLOSE ALL OUTPUT FILES FOR THE DISK INVOLVED, AND THEN UPDISK IS CALLED TO UPDATE THE FILE DIRECTORY. 8. FINALLY, IF THE PARAMETER LIST SPECIFIED ALL NAMES AND/OR TYPES, THE PROCESS IS REPEATED, STARTING AT STEP 1, TO ALTER ALL APPROPRIATE FILENAMES, TYPES, OR MODES AS DESIRED.
Calls to Other Routines
DMSLAFP - SEARCHES THE ACTIVE FILE TABLE DMSLFSW - SEARCHES FOR THE SPECIFIED FILE STATUS TABLE ENTRY. DMSLADP - FIND THE ACTIVE DISK TABLE BLOCK WHOSE MODE MATCHES. DMSFNSC - TO TEMPORARILY CLOSE A GIVEN FILE OR ACTIVE DISK TABLE FOR THE PURPOSE OF UPDATING THE FILE DIRECTORY. DMSAUDK - TO RESERVE SPACE ON DISK FOR REWRITING A NEW COPY OF THE USER FILE DIRECTORY ON DISK, AND THEN TO UPDATE THE UFD ON DISK.