File Formatters

Version 22.0.8483


File Formatters

Version 22.0.8483


Overview

The following is a list of formatters that interact with files and folders on disk. The syntax for all formatters is the same: attributes (variables) are “piped” in (using a vertical pipe character) to formatters from left-to-right, e.g.:

[attr | formatter1() | formatter2()]

The attribute piped into File Formatters should always be a path on disk to a file or directory. For example, if the attribute ‘myFile’ is set to a filepath, then the following would return the file extension from that filepath:

[myFile | fileext()]


directory()

Returns the name of the directory specified by the folder path.

direxists([ifexist][, ifnotexist])

This formatter returns true (or the value passed in as ifexist) if the folder at the specified path exists, and false (or the value passed in as ifnotexist) otherwise.

  • ifexist: The optional value returned if the directory exists.
  • ifnotexist: The optional value returned if the directory does not exist.

filectime()

Returns the creation time of the specified file.

fileexists([ifexist][, ifnotexist])

This formatter returns true (or the value passed in as ifexist) if the file at the specified path exists, and false (or the value passed in as ifnotexist) otherwise.

  • ifexist: The optional value returned if the file exists.
  • ifnotexist: The optional value 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, so common practice is to use the default item ‘_’ as the input, e.g.: [_ | 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 true (or ifchild) if the path parameter is a child of the path represented passed in by the attribute value, and false (or ifnotchild) otherwise.

  • path: The path to compare with the path represented by the attribute value.
  • ifchild: The optional value returned if the parameter value is a child of the path represented by the attribute value.
  • ifnotchild: The optional value 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 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 (_).