HELP!

Discussion in 'AutoCAD' started by UVW9183, Jul 25, 2004.

  1. UVW9183

    UVW9183 Guest

    DEAR:
    I PROGRAMMED A SIMPLE LISP FUNCTION, TO WRITE SOMETHING TO A FILE. BEFORE OPENING THE NEW FILE, I WANT TO DELETE THE POSIBLE ORIGINAL ONE, USING THE LINE :

    (command ".shell" (strcat "del " fn)))

    BUT, AT THIS MOMENT, THE FILE IS STILL THERE.
    EVEN WHEN THE FOLLOWING LINE IS ADDED:

    (while (findfile fn))

    IT STILL MISFUNCTIONS SOMETIMES.

    PLEASE HELP ME.
    THANKS VERY MUCH.
     
    UVW9183, Jul 25, 2004
    #1
  2. UVW9183

    Mark Propst Guest

    if you created the filehandle via:
    (open fname "w")
    then you don't need to delete file first, it will overwrite existing
    contents

    if you created the filehandle via:
    (open fname "a")
    then it would append to existing file

    would that help?
    Mark

    OPENING THE NEW FILE, I WANT TO DELETE THE POSIBLE ORIGINAL ONE, USING THE
    LINE :
     
    Mark Propst, Jul 25, 2004
    #2
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.