Skip to content

Filesystem

Allows multiple operations over files on the filesystem.

Categories: helpers

Type: filesystem/v1


Actions

Create Temp Directory

Name: createTempDir

Creates a file in the temporary directory on the filesystem. Returns the created directory’s full path.

Example JSON Structure

{
"label" : "Create Temp Directory",
"name" : "createTempDir",
"type" : "filesystem/v1/createTempDir"
}

Output

Sample Output:

/sample_tmp_dir

Type: STRING

Create

Name: mkdir

Creates a directory.

Properties

NameLabelTypeDescriptionRequired
pathPathSTRINGThe path of a directory.true

Example JSON Structure

{
"label" : "Create",
"name" : "mkdir",
"parameters" : {
"path" : ""
},
"type" : "filesystem/v1/mkdir"
}

Output

Sample Output:

/sample_data

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

NameLabelTypeDescriptionRequired
filenameFile pathSTRINGThe path to full filename.true

Example JSON Structure

{
"label" : "Get Parent Folder",
"name" : "getFilePath",
"parameters" : {
"filename" : ""
},
"type" : "filesystem/v1/getFilePath"
}

Output

Sample Output:

/sample_data

Type: STRING

List

Name: ls

Lists the content of a directory for the given path.

Properties

NameLabelTypeDescriptionRequired
pathPathSTRINGThe path of a directory.true
recursiveRecursiveBOOLEAN
Options true, false
Should the subdirectories be included?null

Example JSON Structure

{
"label" : "List",
"name" : "ls",
"parameters" : {
"path" : "",
"recursive" : false
},
"type" : "filesystem/v1/ls"
}

Output

Type: ARRAY

Items Type: OBJECT

Properties

NameTypeDescription
filenameSTRINGName of the file.
relativePathSTRINGRelative path of the file.
sizeINTEGERSize of the file.

Output Example

[ {
"filename" : "",
"relativePath" : "",
"size" : 1
} ]

Read File

Name: readFile

Reads all data from a specified file path and outputs it in file entry format.

Properties

NameLabelTypeDescriptionRequired
filenameFile pathSTRINGThe path of the file to read.true

Example JSON Structure

{
"label" : "Read File",
"name" : "readFile",
"parameters" : {
"filename" : ""
},
"type" : "filesystem/v1/readFile"
}

Output

Type: FILE_ENTRY

Properties

NameTypeDescription
extensionSTRING
mimeTypeSTRING
nameSTRING
urlSTRING

Output Example

{
"extension" : "",
"mimeType" : "",
"name" : "",
"url" : ""
}

Remove

Name: rm

Permanently removes the content of a directory.

Properties

NameLabelTypeDescriptionRequired
pathPathSTRINGThe path of a directory.true

Example JSON Structure

{
"label" : "Remove",
"name" : "rm",
"parameters" : {
"path" : ""
},
"type" : "filesystem/v1/rm"
}

Output

Sample Output:

true

Type: BOOLEAN

Write to File

Name: writeFile

null

Properties

NameLabelTypeDescriptionRequired
fileEntryFileFILE_ENTRYFile entry object to be written.true
filenameFile pathSTRINGThe path to which the file should be written.true

Example JSON Structure

{
"label" : "Write to File",
"name" : "writeFile",
"parameters" : {
"fileEntry" : {
"extension" : "",
"mimeType" : "",
"name" : "",
"url" : ""
},
"filename" : ""
},
"type" : "filesystem/v1/writeFile"
}

Output

Sample Output:

{bytes=1024}

Type: OBJECT

Properties

NameTypeDescription
bytesINTEGERNumber of bytes written.

Output Example

{
"bytes" : 1
}