* file-exists? now uses bytevectors for filenames.
This commit is contained in:
parent
b54cc9a762
commit
cc500489b7
BIN
bin/ikarus
BIN
bin/ikarus
Binary file not shown.
|
@ -575,7 +575,13 @@ ERRORS
|
|||
*/
|
||||
ikp
|
||||
ikrt_file_exists(ikp filename){
|
||||
char* str = string_data(filename);
|
||||
char* str;
|
||||
if(tagof(filename) == bytevector_tag){
|
||||
str = (char*)filename + off_bytevector_data;
|
||||
} else {
|
||||
fprintf(stderr, "bug in ikrt_file_exists\n");
|
||||
exit(-1);
|
||||
}
|
||||
struct stat sb;
|
||||
int st = stat(str, &sb);
|
||||
if(st == 0){
|
||||
|
|
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -40,7 +40,8 @@
|
|||
(lambda (x)
|
||||
(unless (string? x)
|
||||
(error 'file-exists? "filename ~s is not a string" x))
|
||||
(let ([v (foreign-call "ikrt_file_exists" x)])
|
||||
(let ([v (foreign-call "ikrt_file_exists"
|
||||
(string->utf8-bytevector x))])
|
||||
(cond
|
||||
[(boolean? v) v]
|
||||
[else
|
||||
|
|
Loading…
Reference in New Issue