* delete-file now uses bytevectors for filename rep.
This commit is contained in:
parent
cc500489b7
commit
e499eb0f5a
BIN
bin/ikarus
BIN
bin/ikarus
Binary file not shown.
|
@ -646,7 +646,13 @@ ikrt_file_exists(ikp filename){
|
||||||
|
|
||||||
ikp
|
ikp
|
||||||
ikrt_delete_file(ikp filename){
|
ikrt_delete_file(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_delete_file\n");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
int err = unlink(str);
|
int err = unlink(str);
|
||||||
if(err == 0){
|
if(err == 0){
|
||||||
return 0;
|
return 0;
|
||||||
|
|
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -60,7 +60,8 @@
|
||||||
(lambda (x)
|
(lambda (x)
|
||||||
(unless (string? x)
|
(unless (string? x)
|
||||||
(error 'delete-file "filename ~s is not a string" x))
|
(error 'delete-file "filename ~s is not a string" x))
|
||||||
(let ([v (foreign-call "ikrt_delete_file" x)])
|
(let ([v (foreign-call "ikrt_delete_file"
|
||||||
|
(string->utf8-bytevector x))])
|
||||||
(case v
|
(case v
|
||||||
[(0) (void)]
|
[(0) (void)]
|
||||||
[else
|
[else
|
||||||
|
|
Loading…
Reference in New Issue