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:
Abdulaziz Ghuloum 2008-02-03 17:11:53 -05:00
parent 1a98773440
commit f3c92c9473
3 changed files with 32 additions and 26 deletions

View File

@ -61,16 +61,19 @@
(cond (cond
[(boolean? v) v] [(boolean? v) v]
[else [else
(die 'file-exists? (raise
(case v (condition
[(1) "the path contains a non-directory"] (make-who-condition 'file-exists?)
[(2) "the path is too long"] (make-message-condition
[(3) "the path is not accessible"] (case v
[(4) "the path contains too many symbolic links"] [(1) "file path contains a non-directory"]
[(5) "internal access die while accessing"] [(2) "file path is too long"]
[(6) "IO die encountered while accessing"] [(3) "file path is not accessible"]
[else "Unknown die"]) [(4) "file path contains too many symbolic links"]
x)])))) [(5) "internal access error while accessing file"]
[(6) "IO error encountered while accessing file"]
[else "Unknown error while testing file"]))
(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
(case v (condition
[(1) "the path contains a non-directory"] (make-who-condition 'delete-file)
[(2) "the path is too long"] (make-message-condition
[(3) "the file does not exist"] (case v
[(4) "the path is not accessible"] [(1) "file path contains a non-directory"]
[(5) "the path contains too many symbolic links"] [(2) "file path is too long"]
[(6) "you do not have permissions to delete file"] [(3) "file does not exist"]
[(7) "device is busy"] [(4) "file path is not accessible"]
[(8) "IO die encountered while deleting"] [(5) "file path contains too many symbolic links"]
[(9) "is in a read-only file system"] [(6) "you do not have permissions to delete file"]
[(10) "internal access die while deleting"] [(7) "device is busy"]
[else "Unknown die while deleting"]) [(8) "IO error encountered while deleting"]
x)])))) [(9) "file is in a read-only file system"]
[(10) "internal access error while deleting"]
[else "Unknown error while deleting file"]))
(make-i/o-filename-error x)))]))))
(define ($getenv-bv key) (define ($getenv-bv key)
(foreign-call "ikrt_getenv" key)) (foreign-call "ikrt_getenv" key))

View File

@ -1 +1 @@
1370 1371

View File

@ -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);