FF API: File Functions

FF API: File Functions

Date Revised: 9/12/23 

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 and FF,03,02,01 - Replace file if it already exists

              In:      Screen-Area: Target long filename

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

            FF,03,02,02 - Do not replace file if it already exists

              In:     Screen-Area: Target long filename

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

            FF,03,02,03 - Copy file and if it already exists append date and time onto file name (filenameYYYYMMDDHHMMSS.ext)

              In:     Screen-Area: Target long filename

              Out:   Screen-Answer: "Y" if successful; "N" if not

                        Screen-Area: This will contain the new name of the file


  • 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


  • FF,10 Move file

           FF,10,01

              In:     Screen-Area: Source long filename

           FF,10,02 - Move file and if it already exists append date and time onto file name (filenameYYYYMMDDHHMMSS.ext)

              In:     Screen-Area: Target long filename

              Out:  Screen-Answer: "Y" if successful; "N" if not

                        Screen-Area: This will contain the new name of the file

 JEG/CLS

NWSMSCRN.CBL




    • Related Articles

    • Change - CSV Import Programs to Support File Names Longer Than 20 Characters

      Release date: 5/5/2021 Version 8.5 & Up There were many Elliott CSV Import programs which had a limitation that the maximum file name could not be greater than 20 characters. See the following KB article: ...
    • FA API Changes (V9.0)

      FA: File Access (Without File Handling) This API can be used to retrieve an individual field from a specific record in a file without specifying the file in the program and without opening and closing the file. In its simplest form, one can, for ...
    • Avalara Source Code Integration - AV API Call

      Release Date: 11/16/21 Revised: 05/23/22 Version: 8.6 and Above This article is intended for Elliott Business Software developers. This API call will allow the programmer to pass a value to indicate which Avalara function is to be performed. The ...
    • GK API

      Release Date: 07/08/2021 Revised Date: 05/05/2022 This API allows the programmer to determine whether or not certain keystrokes have been pressed. Screen-Parameters: GK,nn nn provides different functionality as follows: GK Wait for the next keystroke ...
    • Elliott API (JSON REST Web Service)

      Introduction In the past, Elliott web services is based on SOAP standard since that is the first web services standard created for the industry. Since then, RESTful APIs (Representational State Transfer) have become the backbone of modern web ...