Implement copy-file on Windows

release
Slava Pestov 2007-11-24 16:38:20 -05:00
parent 90731836af
commit aaa493ebd2
2 changed files with 7 additions and 1 deletions

View File

@ -97,7 +97,9 @@ TUPLE: no-parent-directory path ;
] } ] }
} cond drop ; } cond drop ;
: copy-file ( from to -- ) HOOK: copy-file io-backend ( from to -- )
M: object copy-file
dup parent-directory make-directories dup parent-directory make-directories
<file-writer> [ <file-writer> [
stdio get swap stdio get swap

View File

@ -116,6 +116,10 @@ M: windows-io delete-file ( path -- )
normalize-pathname normalize-pathname
DeleteFile win32-error=0/f ; DeleteFile win32-error=0/f ;
M: windows-io copy-file ( from to -- )
normalize-pathname
f CopyFile win32-error=0/f ;
M: windows-io make-directory ( path -- ) M: windows-io make-directory ( path -- )
normalize-pathname normalize-pathname
f CreateDirectory win32-error=0/f ; f CreateDirectory win32-error=0/f ;