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 ? )
|
||||
! return true if file was just created
|
||||
flags{ GENERIC_READ GENERIC_WRITE }
|
||||
share-mode
|
||||
f
|
||||
OPEN_ALWAYS
|
||||
0 CreateFile-flags
|
||||
f CreateFileW dup win32-error=0/f <win32-file>
|
||||
OPEN_ALWAYS 0 open-file
|
||||
GetLastError ERROR_ALREADY_EXISTS = not ;
|
||||
|
||||
: set-file-pointer ( handle length method -- )
|
||||
|
|
Loading…
Reference in New Issue