FT Environment

 FT_COM3OR4()     Enable use of COM3 and/or COM4 on IBM/PC compatables.
 FT_DIR2DB()      Create .DBF of directory files, using DOS filespec
 FT_EXIST()       Test for drive and/or subdir on SINGLE-USER systems only.
 FT_GETE()        Return the entire current environment
 FT_LINKED()      Determine if a function was linked in
 FT_ORIGIN()      Report the drive, path and filename of the current program
 FT_RESTSETS()    Restore status of all SET command settings
 FT_SAVESETS()    Save the status of all the SET command settings
 FT_SETCENTURY()  Check/Set the CENTURY Setting
 FT_TREE()        Locate all directories and subdirectories on a drive
 FT_WHEREIS()     Locate all occurrences of a filespec on a drive

 

FT_WHEREIS

FT_WHEREIS()
 Locate all occurrences of a filespec on a drive

 Syntax

     FT_WHEREIS( [ <cDrive:> ][ <cFilespec> ] ) -> aFiles

 Arguments

    <cDrive:> is an optional drive to search.  If omitted, FT_WHEREIS()
    defaults to the current drive.

    <cFilespec> is a DOS legal filespec containing the pattern that
    you want found.  The wildcard characters "*" and "?" are supported.
    If no <cFilespec> is specified, FT_WHEREIS() defaults to all files.

 Returns

    An array of filenames that match <cFilespec>.

 Description

    Use FT_WHEREIS() to obtain an array with the full path/filenames of all
    files on the specified or current drive that match a DOS legal filespec.

    You may optionally specify a drive to search, other than the current
    drive.  Please note that FT_WHEREIS() will not cause a runtime error if
    you specify an invalid or inoperable drive; it instead returns an
    empty array.

 Examples

    /* Example 1 */
    aComSpec := FT_WHEREIS( "command.com" ) // aComSpec now contains an
                                            // entry for every "Command.com"
                                            // on the current drive
    /* Example 2 */
    aBat := FT_WHEREIS( "a:*.bat" )

    IF Empty( aBat )
       ?"Please make sure the proper diskette is in drive A:, and that"
       ?"the drive door is closed."
    ELSE
       ? "You have " + Len( aBat ) " batch files on drive A:"
    ENDIF

 Source: WHEREIS.PRG

 Author: Steve Larsen

See Also: FT_TREE() FT_ORIGIN()



FT_TREE

FT_TREE()
 Locate all directories and subdirectories on a drive

 Syntax

     FT_TREE( [ <cDrive:> ] ) -> aDirectories

 Arguments

    <cDrive:> is an optional drive to search.  If omitted, FT_TREE()
    defaults to the current drive.

 Returns

    An array containing the name of each directory found on the specified
    drive.

 Description

    Use FT_TREE() to obtain an array of the directory structure of a
    specified drive.

    You may optionally specify a drive to search, other than the current
    drive.  Please note that FT_TREE() will not cause a runtime error if
    you specify an invalid or inoperable drive, instead returns an
    empty array.

    The directory structure returned is not ordered in any way other than
    the order that the directories are contained in DOS.  To put the
    directories in alphabetical order, use ASORT().

 Examples

    // list all directories on the current drive
    aTree := FT_TREE()
    Aeval( aTree, {|e| Qout(e) } )

 Source: WHEREIS.PRG

 Author: Steve Larsen

See Also: FT_WHEREIS() FT_ORIGIN()

 

FT_ORIGIN

 FT_ORIGIN()
 Report the drive, path and filename of the current program

 Syntax

     FT_ORIGIN() -> cString

 Arguments

    None

 Returns

    A string containing the full drive/directory/filename of
    the currently executing file.

 Description

    Often users will install multiple copies of application software,
    especially on networks and in situations where the user is trying
    to get around a copy protection scheme.

    This function enables you to learn the name and source location
    of the currently executing file, so that you may take whatever
    action you need to.

    Requires DOS v3.xx and above.

 Examples

    cMyFile := FT_ORIGIN()

    IF cMyFile <> "C:\APPDIR\MYFILE.EXE"
       ?"Incorrect startup file.  Please remove/rename and start again"
       QUIT
    ENDIF

 Header File: extend.h

 Source: ORIGIN.C

 Author: Steve Larsen

See Also: FT_WHEREIS() FT_TREE()