* delete-file now uses bytevectors for filename rep.

This commit is contained in:
Abdulaziz Ghuloum 2007-05-18 22:21:36 -04:00
parent cc500489b7
commit e499eb0f5a
4 changed files with 9 additions and 2 deletions

Binary file not shown.

View File

@ -646,7 +646,13 @@ ikrt_file_exists(ikp filename){
ikp
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);
if(err == 0){
return 0;

Binary file not shown.

View File

@ -60,7 +60,8 @@
(lambda (x)
(unless (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
[(0) (void)]
[else