chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Using errno for reporting errors in open-*-file


From: Alejandro Forero Cuervo
Subject: [Chicken-users] Using errno for reporting errors in open-*-file
Date: Wed, 23 Mar 2005 12:42:09 -0500
User-agent: Mutt/1.5.6+20040907i

I have recently noticed that, on errors, many functions (such as
open-input-file, open-output-file, rename-file and delete-file) don't
use errno for describing the error.  They use a standard message such
as "can not open file" instead of a more descriptive one such as "No
such file or directory" or "Permission denied".  Shouldn't the error
they generate be based on the description provided by the underlying
kernel/C library?

If anyone can explain how to accomplish this with, say,
open-input-file, I would gladly help apply it to other functions.

I've been looking at runtime.c and library.scm, but I'm not sure how
it should be done.  Should library.scm look at the value returned by
the Scheme-level errno procedure and call a wrapper to strerror or
should an additional argument be passed to C_open_file_port (and
similar functions) so they can return a pointer to a string describing
the error?  Can anyone point me to an example as to how a C procedure
can create a Scheme string with the contents of a given char *
(hopefully without having to copy the contents)?

Any help would be appreciated.

Thanks!

Alejo.
http://bachue.com/alejo

---=(  Comunidad de Usuarios de Software Libre en Colombia  )=---
---=(  http://bachue.com/colibri )=--=( address@hidden  )=---




reply via email to

[Prev in Thread] Current Thread [Next in Thread]