.MCALL .MODULE .MODULE DELETE,VERSION=03,COMMENT= GLOBAL=D.ELETE ; Copyright (c) 1998 by Mentec, Inc., Nashua, NH. ; All rights reserved ; ; This software is furnished under a license for use only on a ; single computer system and may be copied only with the ; inclusion of the above copyright notice. This software, or ; any other copies thereof, may not be provided or otherwise ; made available to any other person except for use on such ; system and to one who agrees to these license terms. Title ; to and ownership of the software shall at all times remain ; in Mentec, Inc. ; ; The information in this document is subject to change without ; notice and should not be construed as a commitment by Digital ; Equipment Corporation, or Mentec, Inc. ; ; Digital and Mentec assume no responsibility for the use or ; reliability of its software on equipment which is not supplied ; by Digital or Mentec, and listed in the Software Product ; Description. .ENABL GBL,LC .SBTTL Macro definitions .MCALL .DELETE .MCALL FDBDF$, FERDF$, DEFIN$ FDBDF$ ;Define FDB offsets FERDF$ ;Define file service error codes DEFIN$ ;Definitions for IND files .PSECT $DELET .SBTTL $DELET - Delete file ;+ ;$DELET ;This routine deletes the file associated with the specified FDB. ; ; Input: R1 -> Address of FDB ; ; Output: R1 -> Address of FDB ; C-bit set if error ;- .ENABL LSB $DELET::SAVE TSTB F$FLGS(R1) ;Is the file open? BEQ 1$ ;Branch if no MOV #,R0 ;File already open error BR 2$ 1$: TST F$STAT(R1) ;Is the device random access? .ASSUME FILST$ EQ 100000 BPL 3$ ;Branch if no MOV R1,R2 ;Copy FDB address ADD #F$DNAM,R2 ;Point to the RAD50 file spec .DELETE #EMTBLK,#IN$CHN,R2 ;Delete the file BCC 3$ ;Branch if no error MOV #,R0 ;Assume no such file error CMPB #3,@#52 ;Is the file protected? BNE 2$ ;Branch if no MOV #,R0 ;File protection error 2$: MOV R0,F$ERR(R1) ;Save the error code SEC ;Set c-bit for error BR 4$ ;Restore registers 3$: MOV #,F$ERR(R1) ;Set success code CLC ;Make sure c-bit is clear for success 4$: RESTOR RETURN .DSABL LSB .END