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:
parent
bdc1c5ee84
commit
305766a9fa
1 changed files with 2 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue