Implement copy-file on Windows
							parent
							
								
									90731836af
								
							
						
					
					
						commit
						aaa493ebd2
					
				|  | @ -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 | ||||||
|  |  | ||||||
|  | @ -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 ; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue