file( fn : cs )

Description:

Open a file with the specified name.

Syntax:

file( fn{:cs})

Note:

The function opens a file named fn.

Parameters:

fn

Name of the file to load. Both the absolute path and the relative path are acceptable. If using the relative path, then it is relative to the main path, which is the one configured on the option menu of esProc, and which by default is the current directory (the directory holding the script file)

cs

Character set, which supports jvm's built-in character set and which by default is the default value set by OS

Options:

@s

Search the file names on the non-absolute paths in a specified order: Class path -> Search path-> Main path. The search path is the one configured on the option menu of esProc, and the default main path is the current directory. With this option, the function returns the name of a read-only file

@t

Generate a temporary file under the directory of fn file. Without the fn file, create the temporary file through the Tempory directory, one of esProc options under the Tool menu. When the relative path is used to point to the temporary directory, it is relative to the configured main directory 

@a

Make the write action wait when sharing violation happens

Return value:

A file object

Example:

file("D:/Area.txt":"UTF-8")

Load the Area.txt file from the directory "D:\"; character set is UTF-8.

file("Area.txt")

Load the Area.txt file under the main path.

file@s("data/ Area.txt")

Search the class path first; if not found, then search throughout the list of search paths; lastly, search the main path if not found in the search paths.

file@t("data/Area.txt")

Create a temporary file under the directory data/