File Formatters
Version 23.4.8843
Version 23.4.8843
- directory()
- direxists([ifexist][, ifnotexist])
- filectime()
- fileexists([ifexist][, ifnotexist])
- fileext()
- filemtime()
- filename()
- filesize()
- fullpath()
- getcwd()
- getdirname()
- getfilectime()
- getfileext()
- getfilemtime()
- getfilename()
- getfilesize()
- getfullpath()
- getrootpath()
- ischild(path[, ifchild][, ifnotchild])
- pathcombine(path)
- rootpath()
- tofilename()
File Formatters
The list of formatters on this page interact with files and folders on disk. The syntax for all formatters is the same, as shown below:
[attr | formatter1() | formatter2()]
Attributes (variables) are piped in (using a vertical pipe character - |
) to formatters from left to right. The attribute that is piped into file formatters should always be a path on disk to a file or to a directory. For example, if the attribute myFile
is set to a file path, then the following code returns the file extension from that file path:
[myFile | fileext()]
directory()
Returns the name of the directory that is specified by the folder path.
direxists([ifexist][, ifnotexist])
This formatter returns a value of true
(or the value passed in as ifexist
) if the folder at the specified path exists; otherwise, a value of false
(or the value passed in as _
ifnotexist`) is returned.
-
ifexist: The optional value that is returned if the directory exists.
-
ifnotexist: The optional value that is returned if the directory does not exist.
filectime()
Returns the creation time of the specified file.
fileexists([ifexist][, ifnotexist])
This formatter returns a value of true
(or the value passed in as ifexist
) if the file at the specified path exists; otherwise, a value of false
(or the value passed in as ‘ifnotexist`) is returned.
-
ifexist: The optional value that is returned if the file exists.
-
ifnotexist: The optional value that is returned if the file does not exist.
fileext()
Returns the file extension from the specified file.
filemtime()
Returns the last modification time of the specified file.
filename()
Returns the file name from the specified file.
filesize()
Returns the file size from the specified file.
fullpath()
Returns the absolute path for the specified file or folder.
getcwd()
Returns the current working directory. The attribute that is passed into this formatter is ignored. Therefore, common practice is to use the default item _
as the input (for example, [_ | getcwd()]
getdirname()
Returns the directory name from the specified path.
getfilectime()
Returns the creation time of the specified file.
getfileext()
Returns the file extension from the specified file.
getfilemtime()
Returns the last modification time of the specified file.
getfilename()
Returns the file name from the specified path.
getfilesize()
Returns the file size from the specified file.
getfullpath()
Returns the absolute path for the specified path.
getrootpath()
Returns the root directory for the specified path.
ischild(path[, ifchild][, ifnotchild])
Returns a value of true
(or ifchild
) if the path
parameter is a child of the path represented that is passed in by the attribute value; otherwise, the value false
(or ifnotchild
) is returned.
-
path: The path to compare with the path that is represented by the attribute value.
-
ifchild: The optional value that is returned if the parameter value is a child of the path represented by the attribute value.
-
ifnotchild: The optional value that is returned if the parameter value is not a child of the path represented by the attribute value.
pathcombine(path)
Combines two path strings.
- path: The path that is to be combined with the path represented by the attribute value.
rootpath()
Returns the root directory for the specified path.
tofilename()
Converts the attribute value to a valid file name. Replaces invalid characters with an underscore (_).