About vl-file-delete

Discussion in 'AutoCAD' started by Kari, Apr 6, 2005.

  1. Kari

    Kari Guest

    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)
    )

    )

    )
     
    Kari, Apr 6, 2005
    #1
  2. Kari

    Shane-W Guest

    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.
     
    Shane-W, Apr 6, 2005
    #2
  3. Kari

    Kari Guest

    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?
     
    Kari, Apr 6, 2005
    #3
  4. Kari

    Jürg Menzi Guest

    Hi Kari

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

    Cheers
     
    Jürg Menzi, Apr 6, 2005
    #4
  5. Kari

    Kari Guest

    Hmm... interesting...

    Kari
     
    Kari, Apr 7, 2005
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.