rename

fnvoid rename(RF, RT)(RF from, RT to) if ((isSomeFiniteCharInputRange!RF || isSomeString!RF) && !isConvertibleToString!RF && (isSomeFiniteCharInputRange!RT || isSomeString!RT) && !isConvertibleToString!RT)

Rename file from _to to, moving it between directories if required. If the target file exists, it is overwritten.

It is not possible to rename a file across different mount points or drives. On POSIX, the operation is atomic. That means, if to already exists there will be no time period during the operation where to is missing. See

manpage for rename

for more details.

Parameters

fromstring or range of characters representing the existing file name
tostring or range of characters representing the target file name

Throws

FileException on error.
fnvoid rename(RF, RT)(auto ref RF from, auto ref RT to) if (isConvertibleToString!RF || isConvertibleToString!RT)

ditto