Share via


File Management

These commands and functions manage and manipulate disk files.

Use

To

ADDBS( ) Function

Add a backslash to a path expression. 

ADIR( ) Function

Place information about files into an array and then return the number of files. 

CD | CHDIR Command

Change the default Visual FoxPro directory to the directory you specify. 

CLOSE Commands

Close various file types. 

COPY FILE Command

Duplicate any type of file. 

CREATE VIEW Command

Create a view file from the Visual FoxPro environment. 

CURDIR( ) Function

Return the current directory. 

DEFAULTEXT( ) Function

Return a file name with a new extension if one does not already exist. 

DELETE FILE Command

Delete a file from a disk. 

DIR or DIRECTORY Command

Display information about the files in a directory. 

DISPLAY FILES Command

Display information about files. 

DISKSPACE( ) Function

Return the number of bytes available on the default or specified disk drive or volume. 

DO Command

Execute a Visual FoxPro program or procedure.

DRIVETYPE( ) Function

Return the type of the specified drive. 

EDITSOURCE( ) Function

Open the Visual FoxPro editor and, optionally positions the cursor.  

ERASE Command

Erase a file from disk. 

FDATE( ) Function

Return the last modification Date or DateTime for a file. 

FTIME( ) Function

Return the last modification time for a file. 

FILE( ) Function

Locate the specified file. 

FILETOSTR( ) Function

Return the contents of a file as a character string. 

FLUSH Command

Save table and index changes to disk.  

FORCEEXT( ) Function

Return a string with the old file name extension replaced by a new extension. 

FORCEPATH( ) Function

Return a file name with a new path name substituted for the old one. 

FULLPATH( ) Function

Return the path to a specified file or the path relative to another file. 

GETFILE( ) Function

Display the Open dialog box and returns the name of the file you chose. 

GETPICT( ) Function

Display the Open Picture dialog box and return the name of the picture file you chose. 

ISNULL( ) Function

Return true (.T.) if an expression evaluates to a null value; otherwise, ISNULL( ) returns false (.F.). 

JUSTDRIVE( ) Function

Return the drive letter from a complete path. 

JUSTEXT( ) Function

Return the file name portion of a complete path and file name. 

JUSTFNAME( ) Function

Return the file name portion of a complete path and file name. 

JUSTPATH( ) Function

Return the path portion of a complete path and file name. 

JUSTSTEM( ) Function

Return the stem name (the file name before the extension) from a complete path and file name. 

LIST Commands

Display table or environment information without pausing the main Visual FoxPro or user-defined window. 

LOCFILE( ) Function

Locate a file on disk and returns the file name with its path. 

MD | MKDIR Command

Create a new directory or subdirectory on disk. 

MODIFY COMMAND Command

Open an editing window so you can modify or create a program file. 

MODIFY FILE Command

Open an editing window so you can modify or create a text file. 

NVL( ) Function

Return a non-null value from two expressions. 

OPEN DATABASE Command

Opens a database. 

PUTFILE( ) Function

Invoke the Save As dialog box and return the file name you specify. 

RD | RMDIR Command

Remove a directory or folder from disk. 

RENAME Command

Change the name of a file to a new name. 

SET ALTERNATE Command

Direct screen or printer output created with ?, ??, DISPLAY, or LIST to a text file. 

SET DEFAULT Command

Specify the default drive and directory. 

SET FULLPATH Command

Specify if CDX( ), DBF( ), MDX( ), and NDX( ) return the path in a file name. 

SET PATH Command

Specify a path for file searches. 

SET SAFETY Command

Display a dialog box before overwriting an existing file, or evaluate table or field rules, default values, and error messages when changes are made in the Table Designer or with ALTER TABLE. 

SET VIEW Command

Open or close the Data Session window or restores the Visual FoxPro environment from a view file. 

STRTOFILE( ) Function

Write the contents of a character string to a file. 

SYS(3) - Legal File Name

Return a legal file name that can be used to create temporary files. 

SYS(2000) - File Name Wildcard Match

Return the name of the first file in alphabetic order by file name and extension, that matches a file name skeleton. 

SYS(2014) - Minimum Path

Returns the minimum path relative to the current or specified directory for a specified file. 

TYPE Command

Display the contents of a file. 

See Also

Other Resources

Visual FoxPro Environment

Language Categories