mirror of
				https://github.com/janet-lang/janet
				synced 2025-10-31 15:43:01 +00:00 
			
		
		
		
	copyfile should copy permission bits
This commit is contained in:
		| @@ -4019,12 +4019,13 @@ | |||||||
|  |  | ||||||
|   (defn- copyfile |   (defn- copyfile | ||||||
|     [from to] |     [from to] | ||||||
|  |     (def mode (os/stat from :permissions)) | ||||||
|     (def b (buffer/new 0x10000)) |     (def b (buffer/new 0x10000)) | ||||||
|     (with [ffrom (file/open from :rb)] |     (with [ffrom (file/open from :rb)] | ||||||
|       (with [fto (file/open to :wb)] |       (with [fto (file/open to :wb)] | ||||||
|         (forever |         (forever | ||||||
|           (file/read ffrom 0x10000 b) |           (file/read ffrom 0x10000 b) | ||||||
|           (when (empty? b) (buffer/trim b) (break)) |           (when (empty? b) (buffer/trim b) (os/chmod to mode) (break)) | ||||||
|           (file/write fto b) |           (file/write fto b) | ||||||
|           (buffer/clear b))))) |           (buffer/clear b))))) | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Calvin Rose
					Calvin Rose