mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
Bug fix: change non-fmRead file mode to set GENERIC_READ or GENERIC_WRITE
instead of GENERIC_ALL which on 64bit windows rasied an [OSError] exception
This commit is contained in:
@@ -116,7 +116,8 @@ proc open*(filename: string, mode: FileMode = fmRead,
|
||||
template callCreateFile(winApiProc, filename: expr): expr =
|
||||
winApiProc(
|
||||
filename,
|
||||
if readonly: GENERIC_READ else: GENERIC_ALL,
|
||||
# GENERIC_ALL != (GENERIC_READ or GENERIC_WRITE)
|
||||
if readonly: GENERIC_READ else: GENERIC_READ or GENERIC_WRITE,
|
||||
FILE_SHARE_READ,
|
||||
nil,
|
||||
if newFileSize != -1: CREATE_ALWAYS else: OPEN_EXISTING,
|
||||
|
||||
Reference in New Issue
Block a user