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

    • Programming API Codes

      This document is provided for Elliott software developers. If you are not an Elliott software developer, this document is not meaningful for you. AP: Get SMA Values This API returns various values from the Shared Memory Area. For example: Move ‘AP’ ...
    • TB API

      Release Date: 11/25/2020 Versions: 8.5 and Higher Toolbar Functionality This API affects the appearance and functionality of the Amigos buttons (Notes, Attributes, Contacts, Links, Events, General Events) and Special Functions button on the Elliott ...
    • Report Desk: Global Variables, Parameters and Embedded Functions

      Release Date: TBA Version 8.6 Using Global Variables Sometimes it is necessary to access the fields in Elliott's control files, like NSCTLFIL and IMCTLFIL, in order to produce the desired report. For example, in reports that have item cost data, you ...
    • 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 ...