# Directives

FILE | Create New File from File Descriptor

## Format

FILE file_info[,ERR=stmtref]
Where:

file_info | Contents provide the internal file description for the file to create. String expression.
stmtref | Program line number or statement label to which to transfer control.

#### Warning!
The FILE directive will not recreate an embedded data dictionary. When you have an embedded data dictionary, use a PURGE or REFILE directive instead to clear the data from an existing file and preserve the dictionary.

## Description

Use the FILE directive to define a file based on the contents returned by the FID( ) or FIB( ) functions. These functions return character strings with the file type, size and format.

#### Note 1:
The format of the FID( ) value will depend on the current emulation mode you are using for PxPlus. To avoid potential problems when running in emulation modes, use the value returned from the FIB( ) function instead of the FID( ) function.
Note 2:
This directive is not supported by WindX. When you need to create files on a WindX PC, encapsulate the command in an EXECUTE "[WDX]..." directive.

## See Also

FIB( ) Return File Information Block
FID( ) Return File Information Descriptor
PURGE Clear Data from a File
REFILE Clear Record from File
[WDX] Direct Action to Client Machine

## Example

open (2)"PRNTFL"
F$=fid(2)
close (2)
erase "PRNTFL"
file F$
open (2)F$(25,60)