: (delete-file) ( path -- )
dup DeleteFile 0 = [
GetLastError ERROR_ACCESS_DENIED =
- [ delete-read-only-file ] [ win32-error ] if
+ [ delete-read-only-file ] [ throw-win32-error ] if
] [ drop ] if ;
M: windows delete-file ( path -- )
] [
dup n>win32-error-string windows-error
] if ;
+
+: throw-win32-error ( -- * )
+ win32-error-string throw ;
: check-invalid-handle ( handle -- handle )
- dup INVALID_HANDLE_VALUE = [ win32-error-string throw ] when ;
+ dup INVALID_HANDLE_VALUE = [ throw-win32-error ] when ;
CONSTANT: expected-io-errors
${
dup expected-io-error? [
drop
] [
- win32-error-string throw
+ throw-win32-error
] if ;
: io-error ( return-value -- )