[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] delete-file* not working as advertised.
From: |
Graham Fawcett |
Subject: |
Re: [Chicken-users] delete-file* not working as advertised. |
Date: |
Mon, 15 Jan 2007 22:37:58 -0500 |
On 1/15/07, Robin Lee Powell <address@hidden> 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