skip to main content

Library Routines : C$FILEINFO

C$FILEINFO
The C$FILEINFO library routine retrieves information about a file.
FILE-PREFIX settings are ignored by this routine.
Syntax:
 CALL "C$FILEINFO" USING fileName
Parameters:
Return code:
returnCode can be any numeric data item and provides additional information:
Example:
Example - Retrieve file information for a specific file
working-storage section.
01 file-info.
   02 file-size pic x(8comp-x.
   02 file-date pic 9(8comp-x.
   02 file-time pic 9(8comp-x.
77 file-name    pic x(256).
77 retCode      pic s9(2).
procedure division.
   move "c:\myapp\resources\properties1.txt" to file-name
   call "c$fileinfo" using file-name, file-info
        giving retCode
   if retCode = 0
      display message "File size   : " file-size x"0d0a"
                      "Last update : " file-date " - " file-time
   else
      display message "File information could not be retrieved"
   end-if.

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left