Atom

fs.move()

Renames a filesystem entry.

Signature

fs.move(source, destination)

Parameters

Source and destination paths.

Returns

Null.

Behavior

Uses the OS rename operation and its replacement rules.

Errors

Missing source, incompatible destination, cross-device rename or OS failure.

Example

Atom
use fs
use path
p = fs.temporary_directory()
a = path.join(p, 'a')
b = path.join(p, 'b')
write(a, 'Atom')
fs.move(a, b)
assert(not fs.exists(a) and fs.exists(b))
fs.remove(p, true)