Move/rename file/directory

Moves the target file to a new location in the filesystem.

Moves the target file to a new location in the filesystem. Can also be used to rename a file by moving it within the same folder.

Input arguments

Label

Key

Type

Required?

Default

Description

Source file path

sourcePath

String(local-filesystem-reference)

Yes

Absolute local filesystem path to the source file/directory, including possible filename and extension.

Target file path

targetPath

String(local-filesystem-reference)

Yes

Absolute local filesystem path to the target file/directory, including possible filename and extension.

Relative target path?

relativeTargetPath

Boolean

Yes

If true, Target file path is interpreted as relative to the source path parent folder.

Overwrite target file?

overwrite

Boolean

Yes

true

If true, overwrite the target file.

Output arguments

Number of outputs: 2

Label

Key

Type

Description

File

file

Object

Object representing the moved file at its new location. Empty if a directory was moved.

  • Local path

file.path

String

Absolute local filesystem path representing the file location on the device, including the filename and extension. On web, this is created via the [`createObjectURL`](https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL) method.

  • MIME type

file.mimeType

String

MIME type of the file, if it could be determined.

  • Name

file.name

String

Name of the file in the local filesystem, if applicable. Note that the filename and extension are included in the **Local path** property already.

  • Size

file.size

Number

Size of the file, in bytes.

  • Created at

file.createdAt

String

Creation datetime of the file, if it can be determined.

  • Modified at

file.modifiedAt

String

Datetime when the file was last modified, if it can be determined.

Directory

directory

Object

Object representing the moved directory at its new location. Empty if a file was moved

  • Local path

directory.path

String

Absolute local filesystem path representing the directory location on the device.

  • Name

directory.name

String

Name of the directory in the local filesystem, if applicable. Note that the directory name is included in the **Local path** property.

  • Files in directory

directory.files

Array

Array of objects representing the files in the directory.

  • Subdirectories

directory.directories

Array

Array of objects describing subdirectories of the directory.

  • Total size

directory.totalSize

Number

Total size of the directory, in bytes.

Type

type

String

String describing if the moved item was a file or a directory.

Events

No events.

Errors

Label

Code

Description

Unkown error

unknown

Thrown if an unknown error occured while moving the file.