* open-input-file now uses a bytevector representing the filename
during ffi.
This commit is contained in:
parent
498084a6e8
commit
1586986dbe
BIN
bin/ikarus
BIN
bin/ikarus
Binary file not shown.
|
@ -805,7 +805,14 @@ ikp ikrt_read(ikp fd, ikp buff, ikpcb* pcb){
|
|||
|
||||
ikp
|
||||
ikrt_open_input_file(ikp fname, ikpcb* pcb){
|
||||
int fd = open(string_data(fname), O_RDONLY);
|
||||
char* name;
|
||||
if(tagof(fname) == bytevector_tag){
|
||||
name = (char*) fname + off_bytevector_data;
|
||||
} else {
|
||||
fprintf(stderr, "bug in ikrt_open_input_file\n");
|
||||
exit(-1);
|
||||
}
|
||||
int fd = open(name, O_RDONLY);
|
||||
if(fd == -1){
|
||||
return false_object;
|
||||
} else {
|
||||
|
|
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -141,7 +141,8 @@
|
|||
(define $open-input-file
|
||||
(lambda (filename)
|
||||
(close-ports)
|
||||
(let ([fd/error (foreign-call "ikrt_open_input_file" filename)])
|
||||
(let ([fd/error (foreign-call "ikrt_open_input_file"
|
||||
(string->utf8-bytevector filename))])
|
||||
(if (fixnum? fd/error)
|
||||
(let ([port (make-input-port
|
||||
(make-input-file-handler fd/error filename)
|
||||
|
|
Loading…
Reference in New Issue