Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Treatment rename

fs/file::rename


Inputs

⇥ filesystem: Block<FileSystem> (fs/filesystem::FileSystem)
⇥ from: Block<string>
⇥ to: Block<string>

Outputs

↦ completed: Block<void>
↦ error: Block<string>
↦ failed: Block<void>
↦ finished: Block<void>


Rename a file or a directory.

The file, directory or link at from is moved to to, within the same file system, such as to put a directory prepared beside in place. An existing file at to is replaced, an existing directory only when empty.

completed is emitted when it is moved. If it cannot be, failed is emitted and error contains the reason. finished is emitted in both cases.