Data Folder


File system functions come in two forms. Older functions were written as two distinct functions names, only the prefix changed; Where fexists() operates on files in the secure data directory (often named mivadata) and sexists() operates on the web site directory (often called html or httpdocs).

These functions are grouped under Data Folder and Script Folder respectively.

Newer file systems functions contain an additional "location" parameter where location is either 'data' or 'script'. For example file_read( path, location, input_data var ). These functions are grouped together under Either Folder.

Name -- Syntax / Description
fchmod
fchmod( path, mode )
Changes a files or directory permissions.
Returns 1 if sucessful, 0 if fails
  • path = fully qualified path to the file
  • mode_number = ( nnnn decimal number) or '0nnnn' (octal string)
fcopy
fcopy( source, destination )
Copies a file in the data directory.
Returns 1 if sucessful, 0 if fails
  • source = source file fully qualified path
  • destination = destination file fully qualified path
fdelete
fdelete( path )
Deletes a file in the data directory. See sdelete()
Returns 1 if sucessful, 0 if fails
  • path = fully qualified path of the file to delete
fexists
fexists( path )
Tests if the file named in path exists in the data directory.
Returns 1 if the file exsists else 0.
  • path = the fully qualified path to the file
fisdir
fisdir( path )
Tests if the file named in path is a directory.
Returns 1 if the path is a directory else 0.
  • path = the fully qualified path to the directory
fmkdir
fmkdir( path )
Creates a directory specified by path in the data directory.
Returns 1 if sucessful, 0 if fails
  • path = the fully qualified path to the directory
fmode
fmode( path )
Returns the permissions mode of path in the data directory.
Returns the permissions mode or -1 if the file does not exist
  • path = the fully qualified path to the file or directory
frename
frename( source, destination )
Rename source file to destination file. Can rename or move a file in the data directory.
Returns 1 if sucessful, 0 if fails
  • source = source file fully qualified path
  • destination = destination file fully qualified path
fscopy
fscopy( data_source,script_destination )
Copies a file from data directory to the scripts directory.
Returns 1 if sucessful, 0 if fails
  • data_source = source file fully qualified path
  • scripts_destination = destination file fully qualified path
fsize
fsize( path )
Get the size of a file in the data directory
Returns the file size in bytes or -1 if the file does not exist.
  • path = the fully qualified path to the file
fsrename
fsrename( source, destination )
Rename data directory source file to script directory destination file. Can rename or move a file.
Returns 1 if sucessful, 0 if fails
  • source = source file fully qualified path
  • destination = destination file fully qualified path
fssymlink
fssymlink( source, destination )
This function creates a symbolic link from a file in the data directory to the scripts directory (Available on UNIX file systems only)
Returns 1 if sucessful, 0 if fails
  • source = source file fully qualified path in the data directory
  • destination = destination file fully qualified path in the scripts directory
fsymlink
fsymlink( source, destination )
(Unix only) Creates a symbolic link to the file in the data directory.
Returns 1 if sucessful, 0 if fails
  • source = source file fully qualified path
  • destination = destination file fully qualified path
ftime
ftime( path )
Gets the last modified time for the file in data directory.
Returns time_t since a file in the was last modified or -1 if the file does not exist.
  • path = the fully qualified path to the file
User Annotations: filesystem-data