[Ecls-list] DELETE-FILE signalling SIMPLE-ERROR rather than FILE-ERROR.

Mark Cox markcox80 at gmail.com
Sat Aug 25 00:08:58 UTC 2012


G'day,

The hyperspec [1] states that DELETE-FILE should signal an error of type FILE-ERROR if it cannot succeed in deleting a file. ECL currently signals a SIMPLE-ERROR.

> (delete-file "/tmp/non-existent.dylib")

Condition of type: SIMPLE-ERROR
Cannot delete the directory "/tmp/non-existent.dylib".
C library explanation: No such file or directory.



DELETE-FILE is implemented in src/c/unixfsys.d (I think) and contains a call to FElibc_error, which calls FEerror. I would send a patch for DELETE-FILE, but there are other functions in that file that signal a SIMPLE-ERROR rather than a FILE-ERROR. e.g.

FILE-AUTHOR
RENAME-FILE

These may also be considerations but would perhaps break backward compatibility:
EXT::CHDIR
SI::MKDIR
SI::CHMOD

Handling and signalling file errors is fairly common in practice so I am wondering if a new function "FElibc_file_error" should be created and added to external.h.

Thanks
Mark

[1] http://www.lispworks.com/documentation/HyperSpec/Body/f_del_fi.htm



More information about the ecl-devel mailing list