Page 1 of 2

delete-file -> file-error

Posted: Sat Jun 11, 2011 12:40 pm
by I X Code X 1
Hello,

I am running lisp on Allegro CL Express Edition and am getting this error when I try to delete this file. Note: the file does exist and I am running this on Windows.

Code: Select all

CG-USER(12): (delete-file "C:/acl82express/output.txt")

Error: deleting "C:\\acl82express\\output.txt" resulted in error (code
       13): Permission denied.
[condition type: FILE-ERROR]
I am getting the same error with rename-file. Any idea why this might be happening? I've tried it with a pathname too (#p), but both the pathname and namestrings are giving me this error :cry:

Thanks!

Re: delete-file -> file-error

Posted: Sat Jun 11, 2011 12:50 pm
by ramarren
The error message tells you what the error is: permission denied. Windows has had file permissions for a long time now. Unfortunately I don't really know in detail how that works there, but presumably the file was created by a different user or is read only. Check file properties.

Re: delete-file -> file-error

Posted: Sat Jun 11, 2011 12:58 pm
by I X Code X 1
Gah, I was hoping you weren't going to say that. I've gone into the file and change it's permissions -- allowing everything. Also went to the directory itself and changed it's permissions -- again allowing everything. Yet I am still getting this error. Is there perhaps a better way to delete files/rename files on Windows using CL?

Thanks!

Re: delete-file -> file-error

Posted: Sat Jun 11, 2011 1:04 pm
by ramarren
Are you sure it is not set read only? I believe the attribute is set in a different tab that permissions as such.

I don't think there is a better way. Unless you want to directly call Windows API, but presumably it would tell you the same thing.

Re: delete-file -> file-error

Posted: Sat Jun 11, 2011 1:11 pm
by I X Code X 1
Well I have written to it. I just made a simple .txt file, wrote some text to it, and now I am trying to either delete or rename it. The read-only check box has not been checked and has read,write and modify permissions.

Hmm, I guess I blame windows :roll:

Re: delete-file -> file-error

Posted: Sat Jun 11, 2011 1:13 pm
by Indecipherable
Try deleting the file if it is e.g on your desktop.

Re: delete-file -> file-error

Posted: Sat Jun 11, 2011 1:15 pm
by I X Code X 1
Actually, looking back at it...I have found that the directory is set to read-only. However, any attempt to change this is not working. I uncheck it and when I come back it has been checked again. I did of course hit apply and ok.

Re: delete-file -> file-error

Posted: Sat Jun 11, 2011 1:18 pm
by Indecipherable
I also have such permissions, but you do not seem to be bound by any "windows chains" outside the Program Files directory, etc.

Re: delete-file -> file-error

Posted: Sat Jun 11, 2011 1:23 pm
by I X Code X 1
Indecipherable wrote:I also have such permissions, but you do not seem to be bound by any "windows chains" outside the Program Files directory, etc.

Sorry, this is the first time I've really tried working with files. Are you saying there is a way to stop this from happening and allow me to look into the contents of this directory and modify/delete files?

Re: delete-file -> file-error

Posted: Sat Jun 11, 2011 1:28 pm
by Indecipherable
Now I am not so sure... What is the default directory that you are in when the terminal loads? Try typing (cd)