Filesystem
Allows multiple operations over files on the filesystem.
Categories: helpers
Type: filesystem/v1
Actions
Read File
Name: readFile
Reads all data from a specified file path and outputs it in file entry format.
Properties
Name | Label | Type | Control Type | Description | Required |
---|---|---|---|---|---|
filename | File path | STRING | TEXT | The path of the file to read. | true |
Output
Type: FILE_ENTRY
Properties
Name | Type | Control Type |
---|---|---|
extension | STRING | TEXT |
mimeType | STRING | TEXT |
name | STRING | TEXT |
url | STRING | TEXT |
Write to File
Name: writeFile
null
Properties
Name | Label | Type | Control Type | Description | Required |
---|---|---|---|---|---|
fileEntry | File | FILE_ENTRY | FILE_ENTRY | File entry object to be written. | true |
filename | File path | STRING | TEXT | The path to which the file should be written. | true |
Output
Sample Output:
{bytes=1024}
Type: OBJECT
Properties
Name | Type | Control Type |
---|---|---|
bytes | INTEGER | INTEGER |
Create Temp Directory
Name: createTempDir
Creates a file in the temporary directory on the filesystem. Returns the created directory’s full path.
Properties
Name | Label | Type | Control Type | Description | Required |
---|---|---|---|---|---|
null |
Output
Sample Output:
/sample_tmp_dir
Type: STRING
Get Parent Folder
Name: getFilePath
Gets the path of the parent folder of the file. If the file doesn’t exist, it throws an error.
Properties
Name | Label | Type | Control Type | Description | Required |
---|---|---|---|---|---|
filename | File path | STRING | TEXT | The path to full filename. | true |
Output
Sample Output:
/sample_data
Type: STRING
List
Name: ls
Lists the content of a directory for the given path.
Properties
Name | Label | Type | Control Type | Description | Required |
---|---|---|---|---|---|
path | Path | STRING | TEXT | The path of a directory. | true |
recursive | Recursive | BOOLEAN | SELECT | Should the subdirectories be included? | null |
Output
Type: ARRAY
Properties
Name | Type | Control Type |
---|---|---|
{STRING(fileName), STRING(relativePath), INTEGER(size)} | OBJECT_BUILDER |
Create
Name: mkdir
Creates a directory.
Properties
Name | Label | Type | Control Type | Description | Required |
---|---|---|---|---|---|
path | Path | STRING | TEXT | The path of a directory. | true |
Output
Sample Output:
/sample_data
Type: STRING
Remove
Name: rm
Permanently removes the content of a directory.
Properties
Name | Label | Type | Control Type | Description | Required |
---|---|---|---|---|---|
path | Path | STRING | TEXT | The path of a directory. | true |
Output
Sample Output:
true
Type: BOOLEAN