! ----- COPY_FILE.FUN ----- ! ! ----- LOCAL FUNCTION TO COPY A FILE ----- ! ! ---------- PASSED: ---------- ! ----- SOURCE_FILE = File to be copied ----- ! ----- DESTINATION_FILE = New file to be copied to ----- ! ! ---------- RETURNED: ---------- ! ----- COPY_FILE returns SS$_NORMAL if successful, otherwise ! ----- returns VMS system service error status ! ! ----- Last Change 07/06/93 by Brian Lomasky ----- ! FUNCTION LONG COPY_FILE(STRING SOURCE_FILE, STRING DESTINATION_FILE) %INCLUDE "NUSER.INC" DECLARE LONG LOCAL_STATUS ! LOCAL SYSTEM SERVICE EXIT STAT DIM LONG RMS_CONVERT_OPTIONS(1%)! RMS CONVERT OPTIONS EXTERNAL LONG FUNCTION & CONV$CONVERT ! RMS CONVERT UTILITY EXTERNAL LONG FUNCTION & CONV$PASS_FILES ! SPECIFIC FILES TO RMS CONVERT EXTERNAL LONG FUNCTION & CONV$PASS_OPTIONS ! SPECIFY OPTIONS TO RMS CONVERT RMS_CONVERT_OPTIONS(0%) = 1% ! PASSING ONE OPTION RMS_CONVERT_OPTIONS(1%) = 1% ! CREATE A FILE LOCAL_STATUS = CONV$PASS_FILES(SOURCE_FILE, DESTINATION_FILE) IF LOCAL_STATUS <> SS$_NORMAL THEN PRINT "Error from CONV$PASS_FILES" COPY_FILE = LOCAL_STATUS EXIT FUNCTION END IF LOCAL_STATUS = CONV$PASS_OPTIONS(RMS_CONVERT_OPTIONS() BY REF) IF LOCAL_STATUS <> SS$_NORMAL THEN PRINT "Error from CONV$PASS_OPTIONS" COPY_FILE = LOCAL_STATUS EXIT FUNCTION END IF LOCAL_STATUS = CONV$CONVERT IF LOCAL_STATUS <> SS$_NORMAL THEN PRINT "Error from CONV$CONVERT" END IF COPY_FILE = LOCAL_STATUS END FUNCTION