proper parameter order for os.copyFile/os.moveFile
This commit is contained in:
parent
ea2306b301
commit
53cd61546d
2 changed files with 3 additions and 6 deletions
|
|
@ -620,11 +620,9 @@ proc sameFileContent*(path1, path2: string): bool {.rtl, extern: "nos$1".} =
|
||||||
close(a)
|
close(a)
|
||||||
close(b)
|
close(b)
|
||||||
|
|
||||||
proc copyFile*(dest, source: string) {.deprecated, rtl, extern: "nos$1".} =
|
proc copyFile*(source, dest: string) {.rtl, extern: "nos$1".} =
|
||||||
## Copies a file from `source` to `dest`. If this fails,
|
## Copies a file from `source` to `dest`. If this fails,
|
||||||
## `EOS` is raised.
|
## `EOS` is raised.
|
||||||
## **Deprecated since version 0.8.8**: Use this proc with named arguments
|
|
||||||
## only, because the order will change!
|
|
||||||
when defined(Windows):
|
when defined(Windows):
|
||||||
if CopyFileA(source, dest, 0'i32) == 0'i32: OSError()
|
if CopyFileA(source, dest, 0'i32) == 0'i32: OSError()
|
||||||
else:
|
else:
|
||||||
|
|
@ -650,10 +648,8 @@ proc copyFile*(dest, source: string) {.deprecated, rtl, extern: "nos$1".} =
|
||||||
close(s)
|
close(s)
|
||||||
close(d)
|
close(d)
|
||||||
|
|
||||||
proc moveFile*(dest, source: string) {.deprecated, rtl, extern: "nos$1".} =
|
proc moveFile*(source, dest: string) {.rtl, extern: "nos$1".} =
|
||||||
## Moves a file from `source` to `dest`. If this fails, `EOS` is raised.
|
## Moves a file from `source` to `dest`. If this fails, `EOS` is raised.
|
||||||
## **Deprecated since version 0.8.8**: Use this proc with named arguments
|
|
||||||
## only, because the order will change!
|
|
||||||
if crename(source, dest) != 0'i32: OSError()
|
if crename(source, dest) != 0'i32: OSError()
|
||||||
|
|
||||||
proc removeFile*(file: string) {.rtl, extern: "nos$1".} =
|
proc removeFile*(file: string) {.rtl, extern: "nos$1".} =
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ Bugfixes
|
||||||
Changes affecting backwards compatibility
|
Changes affecting backwards compatibility
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
|
|
||||||
|
- Reversed parameter order for ``os.copyFile`` and ``os.moveFile``!!!
|
||||||
- Procs not marked as ``procvar`` cannot only be passed to a procvar anymore,
|
- Procs not marked as ``procvar`` cannot only be passed to a procvar anymore,
|
||||||
unless they are used in the same module.
|
unless they are used in the same module.
|
||||||
- Deprecated ``times.getStartMilsecs``: Use ``epochTime`` or ``cpuTime``
|
- Deprecated ``times.getStartMilsecs``: Use ``epochTime`` or ``cpuTime``
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue