io.files.windows: use open-file to implement maybe-create-file
This fixes error throwing in case of CreateFile failure, and calls add-completion for the file handle on success.char-rename
parent
f530692362
commit
d243e00f54
|
@ -248,11 +248,7 @@ M: windows init-stdio
|
||||||
: maybe-create-file ( path -- win32-file ? )
|
: maybe-create-file ( path -- win32-file ? )
|
||||||
! return true if file was just created
|
! return true if file was just created
|
||||||
flags{ GENERIC_READ GENERIC_WRITE }
|
flags{ GENERIC_READ GENERIC_WRITE }
|
||||||
share-mode
|
OPEN_ALWAYS 0 open-file
|
||||||
f
|
|
||||||
OPEN_ALWAYS
|
|
||||||
0 CreateFile-flags
|
|
||||||
f CreateFileW dup win32-error=0/f <win32-file>
|
|
||||||
GetLastError ERROR_ALREADY_EXISTS = not ;
|
GetLastError ERROR_ALREADY_EXISTS = not ;
|
||||||
|
|
||||||
: set-file-pointer ( handle length method -- )
|
: set-file-pointer ( handle length method -- )
|
||||||
|
|
Loading…
Reference in New Issue