Skip to content

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

NameLabelTypeControl TypeDescriptionRequired
filenameFile pathSTRINGTEXTThe path of the file to read.true

Output

Type: FILE_ENTRY

Properties

NameTypeControl Type
extensionSTRINGTEXT
mimeTypeSTRINGTEXT
nameSTRINGTEXT
urlSTRINGTEXT

JSON Example

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

Write to File

Name: writeFile

null

Properties

NameLabelTypeControl TypeDescriptionRequired
fileEntryFileFILE_ENTRYFILE_ENTRYFile entry object to be written.true
filenameFile pathSTRINGTEXTThe path to which the file should be written.true

Output

Sample Output:

{bytes=1024}

Type: OBJECT

Properties

NameTypeControl Type
bytesINTEGERINTEGER

JSON Example

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

Create Temp Directory

Name: createTempDir

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

Output

Sample Output:

/sample_tmp_dir

Type: STRING

JSON Example

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

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

NameLabelTypeControl TypeDescriptionRequired
filenameFile pathSTRINGTEXTThe path to full filename.true

Output

Sample Output:

/sample_data

Type: STRING

JSON Example

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

List

Name: ls

Lists the content of a directory for the given path.

Properties

NameLabelTypeControl TypeDescriptionRequired
pathPathSTRINGTEXTThe path of a directory.true
recursiveRecursiveBOOLEAN
Options true, false
SELECTShould the subdirectories be included?null

Output

Type: ARRAY

Properties

NameTypeControl Type
OBJECT
Properties {STRING(fileName), STRING(relativePath), INTEGER(size)}
OBJECT_BUILDER

JSON Example

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

Create

Name: mkdir

Creates a directory.

Properties

NameLabelTypeControl TypeDescriptionRequired
pathPathSTRINGTEXTThe path of a directory.true

Output

Sample Output:

/sample_data

Type: STRING

JSON Example

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

Remove

Name: rm

Permanently removes the content of a directory.

Properties

NameLabelTypeControl TypeDescriptionRequired
pathPathSTRINGTEXTThe path of a directory.true

Output

Sample Output:

true

Type: BOOLEAN

JSON Example

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