FF API: File Functions

FF: File Function

This API has several options that help perform operations for file names; in particular, on long file names (length greater than 100 characters and/or containing one of more embedded SPACEs). 

Notes:

  1. This API generally uses Screen-Area instead of Screen-Alpha-Field in order to accommodate filenames up to 160 characters.
  2. Some or these APIs require multiple calls to achieve the desired result.
The function performed depends on the value passed in Screen-Row:  

  • FF,01 Check if directory exists

.              In:     Screen-Area: Long pathname ending in "\", or Long filename whose directory 

                       is to be checked

.              Out:  Screen-Answer: "Y" if path exists; "N" if not

.                      Screen-Numeric-Field: Size of file if file exists, otherwise 0

 

  • FF,02 Check if file exists

.              In:     Screen-Area: Long filename

.              Out:  Screen-Answer: "Y" if file exists; "N" if not

 

  • FF,03 Copy file

           FF,03,01

              In:      Screen-Area: Source long filename

           FF,03,02

              In:      Screen-Area: Target long filename

              Out:   "Y" if successful; "N" if not

 

  • FF,04 Delete file

              In:      Screen-Area: Long filename

              Out:   Screen-Answer: "Y" if file deleted; "N" if not

 

  • FF,05 Rename file

           FF,05,01

              In:      Screen-Area: Source long filename

           FF,05,02

              In:      Screen-Area: Target long filename

              Out:   "Y" if successfully renamed; "N" if not

 

  • FF,06 Return next file in filespec

           FF,06,01

              In:      Screen-Area: Source long filespec (with wildcards)

              Out:   Screen-Area: Full filename (w/ path) of first file

                       Screen-Answer = "N" means no more qualifying files

            FF,06

              Out:   Screen-Area: Full filename (w/ path) of next file

                       Screen-Answer = "N" means no more qualifying files

 

  • FF,07 Split a filename into components

           FF,07,01

              In:      Screen-Area: Source long filename

              Out:   Screen-Area: Path portion of filename

           FF,07,02

              In:      Screen-Area: Source long filename

              Out:   Screen-Area: base portion of filename

           FF,07,03

              In:      Screen-Area: Source long filename

              Out:   Screen-Area: filename extent (without ".")

 

  • FF,08 Join a filename from components

           FF,08,01

              In:      Screen-Area: Path portion of target filename

           FF,08,02

              In:      Screen-Area: Base portion of target filename

           FF,08,03

              In:      Screen-Area: File extent of target filename

              Out:   Screen-Area: Joined full filename

 

  • FF,09 Get short filename

.              In:      Screen-Area: Long filename

.              Out:   Screen-Area: Short fileName

 JEG

NWSMSCRN.CBL

Feedback and Knowledge Base