On 1/15/07, Robin Lee Powell <[EMAIL PROTECTED]> wrote:
This code:

(if (file-exists? file)
    (delete-file* file))

where file is a symbolic link is giving me:

    Error: (delete-file) can not delete file - Permission denied: "ltest"

Now, this system is wierd in that unlink is re-mapped, but I thought
the documentation for delete-file* was pretty clear that it
shouldn't return any errors?

The documentation reads:
(delete-file* FILENAME)
If the file FILENAME exists, it is deleted and #t is returned. If the
file does not exist,
nothing happens and #f is returned.

Although I agree that the section should not be titled, "Deleting a
file without signalling (sic) an error", it's pretty clear that the
error being consumed is a file-existence error, not a file-permission
error.

The current definition has a nice property, idempotence: whether you
call (delete-file* "foo") once or a hundred times, the effect is the
same, that is, you are assured that the file "foo" does not exist.
That property would be lost if file-permission errors were silenced.

You can always use (condition-case) to silence other errors if that's
your wish, right?

Graham
_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to