fileWrite operation in the post-job event to write a new line to a log file:
Operations
- Copy a File
- Create a File
- Delete a File
- List all Files
- Create a Directory
- Move a File
- Read a file
- Read a Line in File
- Write to a File
fileCopy
Copies a file or a directory to the path that is specified.| Required Input Attribute | Description |
|---|---|
| source | The name of the file that is to be copied. |
| destination | The name of the file after it is copied. |
| Optional Input Attribute | Description |
|---|---|
| force | If force is set to true, the operation creates missing directories. The allowed values are true and false. The default value is true. |
| mask | The pattern that is used to select the entries that are to be copied. The default value is *. |
| recurse | Recursively copy files and directories. In this case, the destination is assumed to be a directory. The allowed values are false and true. The default value is false. |
| Output Attribute | Description |
|---|---|
| file:source | The full path of the source file. |
| file:destination | The full path of the destination file. |
fileCreate
Creates a text file and, optionally, writes to it.| Required Input Attribute | Description |
|---|---|
| file | The name of the file that is to be created. |
| Optional Input Attribute | Description |
|---|---|
| force | If force is set to true, the operation creates missing directories. The allowed values are true and false. The default value is true. |
| data | The data that is to be written in the file. |
| mode | The mode of writing. The allowed values are truncate and append. The default value is truncate. |
| encoding | The encoding of the file. The default value is UTF-8. |
| Output Attribute | Description |
|---|---|
| file:file | The full path of the file that is created. |
| file:cdate | The creation date of the file. |
fileDelete
Deletes a file or a directory.| Required Input Attribute | Description |
|---|---|
| file | The name of the file or directory that is to be deleted. |
| Output Attribute | Description |
|---|---|
| file:file | The name of the file or directory that is deleted. |
fileListDir
Lists the files and the directories in the specified path.| Required Input Attribute | Description |
|---|---|
| path | The path whose directories and files will be listed. The default value is .. |
| Optional Input Attribute | Description |
|---|---|
| mask | The pattern that is used for filtering the result entries. The default value is *. |
| recurse | To list entries recursively. The allowed values are false and true. The default value is false. |
| fileordir | To list only files or directories. The allowed values are all, files, and dirs. The default value is all. |
| Output Attribute | Description |
|---|---|
| file:fullname | The full path of the file or directory in the current entry. |
| file:name | The name of the file or directory in the current entry. |
| file:mtime | The time at which the file or directory in the current entry is written to. |
| file:ctime | The time at which the file or directory in the current entry is created. |
| file:atime | The time at which the file or directory in the current entry is last read from or written to. |
| file:attributes | A list of attributes of the file or directory in the current entry. |
| file:extension | The extension of the entry. |
| file:size | The size of the file in bytes. |
| file:isdir | Whether the entry is a file or a directory. |
fileMakeDir
Creates the directory that is specified by the path.| Required Input Attribute | Description |
|---|---|
| path | The path of the directory that is to be created. |
| Optional Input Attribute | Description |
|---|---|
| force | If force is set to true, the operation creates missing directories. The allowed values are true and false. The default value is true. |
| Output Attribute | Description |
|---|---|
| file:path | The directory that is created. |
| file:cdate | The creation date of the directory. |
fileMove
Moves a file or a directory to the path specified.| Required Input Attribute | Description |
|---|---|
| source | The source path that is to be moved. |
| destination | The destination that is to be moved to. |
| Optional Input Attribute | Description |
|---|---|
| force | If force is set to true, the operation creates missing directories. The allowed values are true and false. The default value is true. |
| Output Attribute | Description |
|---|---|
| file:source | The full path of the source file. |
| file:destination | The full path of the destination file. |
fileRead
Reads a text file and pushes out the data.| Required Input Attribute | Description |
|---|---|
| file | The name of the file that is to be read. |
| Optional Input Attribute | Description |
|---|---|
| encoding | The encoding of the file. The default value is UTF-8. |
| Output Attribute | Description |
|---|---|
| file:data | The file data. |
fileReadLine
Reads a text file and pushes out the next line.| Required Input Attribute | Description |
|---|---|
| file | The name of the file to read. |
| Optional Input Attribute | Description |
|---|---|
| separator | The separator of the file. The default value is the newline character. |
| encoding | The encoding of the file. The default value is UTF-8. |
| Output Attribute | Description |
|---|---|
| file:line | The line number of the file. |
| file:data | The file data. |
fileWrite
Writes encoded data to a file.| Required Input Attribute | Description |
|---|---|
| file | The name of the file that is to be read. |
| data | The data that is to be written in the file. |
| Optional Input Attribute | Description |
|---|---|
| force | If force is set to true, the operation creates missing directories. The allowed values are true and false. The default value is true. |
| mode | The mode of writing. The allowed values are truncate and append. The default value is truncate. |
| encoding | The encoding of the file. The default value is UTF-8. |
| Output Attribute | Description |
|---|---|
| file:file | The full path of the file that is written to. |
| file:cdate | The modified date of the file. |