"Loading SFS Utilities 0.70" $PRINT CRLF ;created 5/28/05 last mod 8/13/05 ;------------ ; "DefName" D2F - writes def to file of same name in current vol ; must be high-level def, otherwise prints error message to file OCTAL DEFINE D2F $DUP $DEFADR IFZ ;if DefName not found $PRINT " not found" $PRINT ELSE ;DefName found... #1 DRV GET $VOL DIRECTORY ;set buffer 1 to current volume FSS GET IFNZ $DROP ELSE ;if error exit otherwise $DUP #1 CNF FSS GET IFNZ $DROP ELSE ;create file, exit if error $DUP #1 OPEN MS_SAVE #1 >FILE >MS ;open file, redirect print to file $DEFADR PDEF "CONSOLE" $PRINT CRLF ;print loadable definition to file <>CON MS_RESTORE #1 CLOSE #1 RELEASE ;undirect, close and release buffer ENDIF ENDIF ENDIF END ;------------ ; "file" destdrv "destvol" FCOPY - copies a file OCTAL DEFINE FCOPY #1 SWAP DIRECTORY ;load destination directory in buffer 1 FSS GET IFNZ $DROP ELSE ;if error drop filename otherwise 2 DRV GET $VOL DIRECTORY ;load current volume directory in buffer 2 FSS GET IFNZ $DROP ELSE ;if error drop filename otherwise 2 $DUP OPEN ;open source file FSS GET IFNZ $DROP ELSE ;if error drop name otherwise #1 $DUP CNF ;try to create destination file FSS GET IFNZ $DROP ELSE ;if error drop name otherwise #1 OPEN ;open destination file 2 #1 BCOPY ;copy buffer 2 to buffer 1 2 CLOSE #1 CLOSE ENDIF ENDIF 2 RELEASE #1 RELEASE ENDIF ENDIF END ;------------ ; "file" destdrv "destvol" FMOVE - moves a file OCTAL DEFINE FMOVE #1 SWAP DIRECTORY ;load destination directory in buffer 1 FSS GET IFNZ $DROP ELSE ;if error drop filename otherwise 2 DRV GET $VOL DIRECTORY ;load current volume directory in buffer 2 FSS GET IFNZ $DROP ELSE ;if error drop filename otherwise 2 $DUP OPEN ;open source file FSS GET IFNZ $DROP ELSE ;if error drop name otherwise #1 $DUP CNF ;try to create destination file FSS GET IFNZ $DROP ELSE ;if error drop name otherwise #1 $DUP OPEN ;open destination file 2 #1 BCOPY ;copy buffer 2 to buffer 1 2 CLOSE #1 CLOSE 2 DEL ;delete source file popping X ENDIF ENDIF 2 RELEASE #1 RELEASE ENDIF ENDIF END ;------------ ; "file" "newfile" FDUP - duplicate file in current directory OCTAL DEFINE FDUP CWA INC GET IFNZ "#1 Busy" $PRINT $DROP $DROP ELSE CWA INC INC GET IFNZ "#2 Busy" $PRINT $DROP $DROP ELSE #1 DRV GET $VOL DIRECTORY 2 DRV GET $VOL DIRECTORY FSS GET IFNZ $DROP $DROP ELSE ;if no error $SWAP #1 OPEN ;OPEN SOURCE FILE IN BUFFER 1 FSS GET IFNZ $DROP ELSE ;IF NO ERROR... $DUP 2 CNF ;TRY TO CREATE NEW FILE FSS GET IFNZ $DROP ELSE ;IF NO ERROR... 2 OPEN ;OPEN DEST FILE IN BUFFER 2 #1 2 BCOPY ;COPY BUFFER 1 TO BUFFER 2 2 CLOSE ;WRITE NEW FILE TO DISK ENDIF ENDIF ENDIF #1 RELEASE 2 RELEASE ENDIF ENDIF END ;------------ CONSOLE ;changes... ;8/12/05 0.70 fixed bugs in FCOPY FMOVE, now req. BCOPY (moved to SFS.IPL) ; added FDUP, modified all to use buffers 1/2 leaving buffer 0 free ;5/30/05 0.69 added BCOPY FMOVE, modified FCOPY ;5/28/05 original with D2F and FCOPY