Merge pull request #7536 from FedericoCeratto/patch-3

Allow searching for "rename file" in documentation
This commit is contained in:
Dominik Picheta
2018-04-07 13:03:22 +01:00
committed by GitHub

View File

@@ -615,6 +615,7 @@ proc tryMoveFSObject(source, dest: string): bool =
proc moveFile*(source, dest: string) {.rtl, extern: "nos$1",
tags: [ReadIOEffect, WriteIOEffect].} =
## Moves a file from `source` to `dest`. If this fails, `OSError` is raised.
## Can be used to `rename files`:idx:
if not tryMoveFSObject(source, dest):
when not defined(windows):
# Fallback to copy & del