Most functions below are actually handled as generic functions in 'FileSystem' data type.
Native OS file
FTP remote file
HTTP remote file

You must include module /pliant/admin/file.pli in order to use the following functions.

file_list path flags -> files
  arg Str path ; arg Int flags ; arg Array:FileInfo files

List the files in the selected path.

The available flags are:
reduced List only names (dont fill size and date fields)
standard Fill all standard informations (name, size and date)
extended Fill all informations, including links, extended attributes
maximal Also fill informations that need to scan the file such as format or md5 checksum (not implemented yet)
relative The filename is returned relative to the provided path instead of as absolute path
recursive Also list files in subdirectories
directories Also list sub directories
nolinks Do not list files that are symbolic links
dirlinks Also list directories that are symbolic links

Be very careful that listing a directory with 'recursive' and 'dirlinks' may crash the program due to infinite recursion.
Please also notice that in Pliant, a path must end by a '/' sign.

file_query filename flags -> info
  arg Str filename ; arg Int flags ; arg_w FileInfo info

Get informations about a specific file. Flags are the same as for 'file_list'

file_configure filename command -> status
  arg Str filename command ; arg Status status

Changes non data informations of a file or set configure options for a channel, ...
The available commands depends on the target filename.

For true files, the available commands are:
datetime year/month/day hour:minute:second Changes the file date
mode integer Changes the file mode (Unix rights). This will be rejected by non Unix plateforms.
link "filename" The entry will now be a symbolic link to another entry. Do not use directly; rather use 'file_link' function explained below.
delete Deletes the entry (the file). Do not use directly; rather use 'file_delete' function explained below.
mkdir Creates the directory. Do not use directly; rather use 'file_mkdir' function explained below.
rmdir Removes the directory. Do not use directly; rather use 'file_rmdir' function explained below.

file_copy src dest options -> status
  arg Str src dest options ; arg Status status

The available options are:
simulate do not make the true copy, just simulate
verbose display some informations
delete if 'src' file is missing, then the 'dest' file will be deleted.

file_move src dest -> status
  arg Str src deste ; arg Status status

file_link src dest force -> status
  arg Str src dest ; arg CBool force ; arg Status status

Creates a symbolic link from 'src' to 'dest'.
It will always return failure on non Unix plateforms.

file_clone src dest force -> status
  arg Str src dest ; arg CBool force ; arg Status status

Creates a second entry for the same file in the directories
It will always return failure on non Unix plateforms.

file_rights info owner group on off
  arg FileInfo info ; arg Int owner group on off

file_delete filename -> status
  arg Str filename ; arg Status status

file_extract file in -> status
  arg Str file in ; arg Status status

Extracts the archive file in the specifyed directory.
The archive file may be a .tgz or .tar or .tar.gz file.

file_temporary -> name
  arg Str name

Returns a temporary file name.

file_os_name name -> osname
  arg Str name osname

Return the operating system name of the specifyed file.


file_tree_create filename -> status
  arg Str filename ; arg Status status

file_tree_delete path -> status
  arg Str path ; arg Status status

file_tree_copy src dest options -> status
  arg Str src dest options ; arg Status status

The available options are:
simulate do not make the true copy, just simulate
verbose display some informations
delete if 'src' file is missing, then the 'dest' file will be deleted.

file_tree_cleanup path
  arg Str path

Removes the empty directories that stand in the path or a subpath of it.

file_temporary_cleanup

Removes the temporary directories of terminated Pliant processes.
This function may be usefull only if some Pliant processes don't remove all the temporary files they created. It will mainly append if the process is killed, or crashes in the middle.Also, it is not recommended until your /tmp/ directory gets full of pliantxxx subdirectories.

Updated by Hubert Tonneau on 2000/9/9