About vl-file-delete
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
About vl-file-delete

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
Kari
Guest





Posted: Wed Apr 06, 2005 4:30 pm    Post subject: About vl-file-delete Reply with quote

Have anybody noticed, that command "vl-file-delete" works not so well?

I want to delete accessary txt-file from hard drive after dwg-file is
printed out, but that accessary file don't disappear. I had to do
While-loop and now it works. If I add a counter to the loop, the counter
runs about 1000-2000 times until txt-file has disappear. Okay, of course it
depends the power of the computer (mine is Pentium 2,8 GHz), but still I
wonder, why the file doesn't disappear at first try. Is this problem in
Windows?

Kari


(defun DeleteFile ( / )

(vl-load-com)
(setq loop 1)

(while loop

(if (findfile PathAndFileName)
(vl-file-delete PathAndFileName)
(setq loop nil)
)

)

)

Back to top
Shane-W
Guest





Posted: Wed Apr 06, 2005 7:06 pm    Post subject: Re: About vl-file-delete Reply with quote

If this txt file is created during the end of the plot and your lsp is running exactly after that. it could be that windows has not either finished creating the file or closing the file.

You could be going too fast and that could be why your counter reaches 1-2k cycles before (being allowed to?) deleting the file.
Back to top
Kari
Guest





Posted: Wed Apr 06, 2005 8:02 pm    Post subject: Re: About vl-file-delete Reply with quote

I have made these (test) txt-files many minutes before plotting.

One of our customer wants the routine with LISP, which is polling certain
folder. Their own routine drops to the folder txt-files, which includes the
name of the plotting file. When my routine is polling out, that there is a
new file in folder, the routine reads the content of the file and open the
dwg-file, which name was in txt-file. When dwg has printed out, routine had
to delete txt-file.

Routine works very well, but I am just wondering, why the txt-file is on the
hard disk like chewing gum on the shoe?



Quote:
If this txt file is created during the end of the plot and your lsp is
running exactly after that. it could be that windows has not either
finished creating the file or closing the file.

You could be going too fast and that could be why your counter reaches
1-2k cycles before (being allowed to?) deleting the file.


Back to top
Jürg Menzi
Guest





Posted: Wed Apr 06, 2005 11:19 pm    Post subject: Re: About vl-file-delete Reply with quote

Hi Kari

Visit my homepage -> Free Stuff and search for 'VxDeleteFiles'.

Cheers
--
Juerg Menzi
MENZI ENGINEERING GmbH, Switzerland
http://www.menziengineering.ch
Back to top
Kari
Guest





Posted: Thu Apr 07, 2005 5:22 pm    Post subject: Re: About vl-file-delete Reply with quote

Hmm... interesting...

Kari



"Jürg Menzi" <info@menziengineering.ch> wrote in message
news:4254364F.D54257AC@menziengineering.ch...
Quote:
Hi Kari

Visit my homepage -> Free Stuff and search for 'VxDeleteFiles'.

Cheers
--
Juerg Menzi
MENZI ENGINEERING GmbH, Switzerland
http://www.menziengineering.ch
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB