delete-file -> file-error

Discussion of Common Lisp
ramarren
Posts: 613
Joined: Sun Jun 29, 2008 4:02 am
Location: Warsaw, Poland
Contact:

Re: delete-file -> file-error

Post by ramarren » Sat Jun 11, 2011 1:29 pm

It is vaguely possible that this is somehow fault of Allegro Express Edition. You could try CCL which has a good Windows implementation.

I X Code X 1
Posts: 59
Joined: Sun May 29, 2011 8:52 pm
Location: NY
Contact:

Re: delete-file -> file-error

Post by I X Code X 1 » Sat Jun 11, 2011 1:31 pm

Well I am running it through Allegro CL, so the default-directory is

Code: Select all

CG-USER(3): *default-pathname-defaults*
#P"C:\\acl82express\\"

Yeah I was thinking maybe it is because of ACL. That directory is the one that is not allowing me to modify the contents of it. That seems awfully limited though.

Indecipherable
Posts: 47
Joined: Fri Jun 03, 2011 5:30 am
Location: Behind you.
Contact:

Re: delete-file -> file-error

Post by Indecipherable » Sat Jun 11, 2011 1:43 pm

[

Code: Select all

2]> *default-pathname-defaults*
#P"C:"
[3]> (cd)
#P"C:\\Program Files\\clisp-2.49\\"
And I also can't change the "read-only" attribute of the directory, but I can delete files though. I'm using Clisp.
Don't take the FUN out of DEFUN !

I X Code X 1
Posts: 59
Joined: Sun May 29, 2011 8:52 pm
Location: NY
Contact:

Re: delete-file -> file-error

Post by I X Code X 1 » Sat Jun 11, 2011 3:53 pm

Okay, well if you're using Clisp and you can delete that makes me think it's something to do with acl's directory. Guess I'll have to just put these files somewhere else or use Clisp.

Thanks!

I X Code X 1
Posts: 59
Joined: Sun May 29, 2011 8:52 pm
Location: NY
Contact:

Re: delete-file -> file-error

Post by I X Code X 1 » Sat Jun 11, 2011 4:21 pm

Indecipherable wrote:[

Code: Select all

2]> *default-pathname-defaults*
#P"C:"
[3]> (cd)
#P"C:\\Program Files\\clisp-2.49\\"
And I also can't change the "read-only" attribute of the directory, but I can delete files though. I'm using Clisp.

I tried with clisp and I am nearly there! Though now I am getting a different error:

Code: Select all

(delete-file "C:/Program Files/clisp-2.49/output.txt")

 DELETE-FILE: Cannot delete file
 #P"C:\\Program Files\\clisp-2.49\\output.txt" since there is a file
 stream open to it
How could there be a stream open to it?

I X Code X 1
Posts: 59
Joined: Sun May 29, 2011 8:52 pm
Location: NY
Contact:

Re: delete-file -> file-error

Post by I X Code X 1 » Sat Jun 11, 2011 4:28 pm

After 2 hours of trying I've figured it out, thanks for the help guys:


I still have not found out the issue with ACL, but I think it's safe to say for some odd reason ACL does not want you to put files in its home directory. So bottom line, don't save it there.

As for the above issue, I guess the stream open is the actual file I made and is somehow connected to clisp while it is open. When I close out and come back in it lets me do this. Still seems limited and I'm sure there is a better way. But I assume if I save files somewhere other than these two spots I would get it all to work just fine.


EDIT: Sorry, I'm really not on it today. It is saying a stream is connected to it because I have not closed the file. Also, since I can't seem to do stuff with it in ACl, I could easily just change the *default-pathname-defaults* to be something else so I can easily get to it, and not have to put up with all the excess typing. Thanks again!

Post Reply