Lisp: delete-file

Being a VB(A) programmer I keep on struggling with Lisp code. What I'm trying to achieve is following:From within a Lisp routine I'm trying to delete a file using someting like (delete-file "c:\temp\cleardata.lsp")There is for some reason an error in this line: what would be the correct syntax?Actually, this command should be the last line in that same cleardata.lsp file. After loading and starting the cleardata lisp routine (by VB) I will have to keep my VB program waiting until Bricscad is ready with that cleardata job. The idea is, that as soon as the lispfile is deleted, I can assume the cleardata routine has finished. Does this make sense or is there any other way to keep my program in sync with Bricscad?TIA,Arno van Eeuwen

Comments

  • One solution is to load the "doslib.dll" right at the start, and the use the command : (dos_delete "Drive\Directory\filename")That's all.

  • You may do this in pure lisp:(command "shell" (strcat "del " filename))Assign filename with the filename preferable with full path.Note that a space is after 'del' command.Svend

  • Thank you Svend, your solution works!

  • Happy to help.I might need help also some daý.Svend

  • Raam Finzi, your help is most appreciated as well of course!!!

This discussion has been closed.