Filpath

Filpath creates the access path to a file on a Sage X3 application server.

Syntax

filpath(directory, filename, extension)
filpath(directory, filename, extension, folder)
filpath(directory, filename, extension, folder, volume)
filpath(directory, filename, extension, folder, volume, server)
The parameters are the following:

Comments

The path that is returned does not correspond to an existing file, and has the following format:

server@/root_path/folder/directory/file_name.extension

The file operations such as Openi and Openo, filinfo, are able to manage files with the syntax returned by filpath.

The following rules apply to the parameter values:

For security reasons, the filpath instruction behavior was restricted since Sage X3 runtime version 96.3 to broaden the scope of the runtime security sandbox. Not authorizing the retrieval of file information when the runtime security sandbox does not allow file system access restricts the filpath instruction's behavior.

Examples

# Verify that the CUSTOMER table compiled description can be accessed from the current folder
  If filinfo(filpath("FIL","CUSTOMER","fde",-1),1) <0
     End -20 : # Does not exist
  Endif
# Compute the root path of the current folder
  FOLDER_PATH = filpath("", "", "")
# Path of the "A" volume on the current server
  A_VOLUME_PATH= filpath("!","","","","A")
# Check if a given script exists in the current folder
  If filinfo(filpath("TRT","MYSCRIPT","adx",0),1) <0
     End -20 : # Does not exist
  Endif

See also

adxdir.