From d243e00f54c1df0271d07551aff2287c673b29e7 Mon Sep 17 00:00:00 2001 From: Alexander Iljin Date: Wed, 25 May 2016 10:46:30 +0300 Subject: [PATCH] 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. --- basis/io/files/windows/windows.factor | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/basis/io/files/windows/windows.factor b/basis/io/files/windows/windows.factor index 344e7595fb..afdc17359b 100755 --- a/basis/io/files/windows/windows.factor +++ b/basis/io/files/windows/windows.factor @@ -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 + OPEN_ALWAYS 0 open-file GetLastError ERROR_ALREADY_EXISTS = not ; : set-file-pointer ( handle length method -- )