Fixes bug 188159: delete-file not recognizing "file doesn't exist"
error, and it's not using &i/o-filename
This commit is contained in:
		
							parent
							
								
									1a98773440
								
							
						
					
					
						commit
						f3c92c9473
					
				|  | @ -61,16 +61,19 @@ | ||||||
|         (cond |         (cond | ||||||
|           [(boolean? v) v] |           [(boolean? v) v] | ||||||
|           [else |           [else | ||||||
|            (die 'file-exists? |            (raise | ||||||
|  |              (condition | ||||||
|  |                (make-who-condition 'file-exists?) | ||||||
|  |                (make-message-condition | ||||||
|                  (case v |                  (case v | ||||||
|                     [(1) "the path contains a non-directory"] |                    [(1) "file path contains a non-directory"] | ||||||
|                     [(2) "the path is too long"] |                    [(2) "file path is too long"] | ||||||
|                     [(3) "the path is not accessible"] |                    [(3) "file path is not accessible"] | ||||||
|                     [(4) "the path contains too many symbolic links"] |                    [(4) "file path contains too many symbolic links"] | ||||||
|                     [(5) "internal access die while accessing"] |                    [(5) "internal access error while accessing file"] | ||||||
|                     [(6) "IO die encountered while accessing"] |                    [(6) "IO error encountered while accessing file"] | ||||||
|                     [else "Unknown die"]) |                    [else "Unknown error while testing file"])) | ||||||
|                   x)])))) |                (make-i/o-filename-error x)))])))) | ||||||
| 
 | 
 | ||||||
|   (define delete-file |   (define delete-file | ||||||
|     (lambda (x) |     (lambda (x) | ||||||
|  | @ -81,20 +84,23 @@ | ||||||
|         (case v |         (case v | ||||||
|           [(0) (void)] |           [(0) (void)] | ||||||
|           [else |           [else | ||||||
|            (die 'delete-file |            (raise | ||||||
|  |              (condition | ||||||
|  |                (make-who-condition 'delete-file) | ||||||
|  |                (make-message-condition | ||||||
|                  (case v |                  (case v | ||||||
|                     [(1) "the path contains a non-directory"] |                    [(1) "file path contains a non-directory"] | ||||||
|                     [(2) "the path is too long"] |                    [(2) "file path is too long"] | ||||||
|                     [(3) "the file does not exist"] |                    [(3) "file does not exist"] | ||||||
|                     [(4) "the path is not accessible"] |                    [(4) "file path is not accessible"] | ||||||
|                     [(5) "the path contains too many symbolic links"] |                    [(5) "file path contains too many symbolic links"] | ||||||
|                    [(6) "you do not have permissions to delete file"] |                    [(6) "you do not have permissions to delete file"] | ||||||
|                    [(7) "device is busy"] |                    [(7) "device is busy"] | ||||||
|                     [(8) "IO die encountered while deleting"] |                    [(8) "IO error encountered while deleting"] | ||||||
|                     [(9) "is in a read-only file system"] |                    [(9) "file is in a read-only file system"] | ||||||
|                     [(10) "internal access die while deleting"] |                    [(10) "internal access error while deleting"] | ||||||
|                     [else "Unknown die while deleting"]) |                    [else "Unknown error while deleting file"])) | ||||||
|                   x)])))) |                (make-i/o-filename-error x)))])))) | ||||||
| 
 | 
 | ||||||
|   (define ($getenv-bv key) |   (define ($getenv-bv key) | ||||||
|     (foreign-call "ikrt_getenv" key)) |     (foreign-call "ikrt_getenv" key)) | ||||||
|  |  | ||||||
|  | @ -1 +1 @@ | ||||||
| 1370 | 1371 | ||||||
|  |  | ||||||
|  | @ -657,7 +657,7 @@ ikrt_delete_file(ikptr filename){ | ||||||
|   if(err == 0){ |   if(err == 0){ | ||||||
|     return 0; |     return 0; | ||||||
|   }  |   }  | ||||||
|   switch (err){ |   switch (errno){ | ||||||
|     case ENOTDIR:  return fix(1);     |     case ENOTDIR:  return fix(1);     | ||||||
|     case ENAMETOOLONG: return fix(2); |     case ENAMETOOLONG: return fix(2); | ||||||
|     case ENOENT: return fix(3);      |     case ENOENT: return fix(3);      | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Abdulaziz Ghuloum
						Abdulaziz Ghuloum