diff options
Diffstat (limited to 'lib/pure/os.nim')
-rw-r--r-- | lib/pure/os.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 59a56a1ab..1739718f6 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -1022,7 +1022,7 @@ proc moveFile*(source, dest: string) {.rtl, extern: "nos$1", if moveFileA(source, dest, 0'i32) == 0'i32: raiseOSError(osLastError()) else: if c_rename(source, dest) != 0'i32: - raise newException(OSError, $strerror(errno)) + raiseOSError(osLastError(), $strerror(errno)) when not declared(ENOENT) and not defined(Windows): when NoFakeVars: @@ -1057,7 +1057,7 @@ proc removeFile*(file: string) {.rtl, extern: "nos$1", tags: [WriteDirEffect].} raiseOSError(osLastError()) else: if c_remove(file) != 0'i32 and errno != ENOENT: - raise newException(OSError, $strerror(errno)) + raiseOSError(osLastError(), $strerror(errno)) proc execShellCmd*(command: string): int {.rtl, extern: "nos$1", tags: [ExecIOEffect].} = |