acet-file-attr returns 8208

Discussion in 'AutoCAD' started by Joe Burke, Apr 27, 2004.

  1. Joe Burke

    Joe Burke Guest

    Does anyone know what this means?

    Command: (acet-file-attr "c:\\testfolder")
    8208

    I have a newly installed ACAD 2004 and I was trying to setup the MOVEBAK folder. I
    kept getting: "Not a directory: c:\\testfolder". Looking at the Express Tools
    movebak.lsp file, I'm fairly sure this part of the code is related to the problem.

    (if (and new
    (/= "" new)
    (/= ":\\" (substr new 2))
    (/= Acet:DIRECTORY (acet-file-attr new)) ) ; here - returns 8208
    (progn
    (princ (acet-str-format "Not a directory: %1" new))
    (setq new nil)
    )
    )

    Workaround was this at the command line (setenv "AcetMoveBack" "c:\\testfolder")
    which did the trick. But I'm still curious... If I knew what 8208 meant, maybe I'd
    have a clue about why MOVEBAK thinks it can't use that folder. I doubt it matters,
    but the C: drive on this machine is a RAID mirror setup.

    Thanks
    Joe Burke
     
    Joe Burke, Apr 27, 2004
    #1
  2. File attributes are byte encoded integers,
    so you have to mask other bits:

    (if (eq acet:directory
    (logand
    acet:directory
    (acet-file-attr <file>)
    )
    )
    (princ "\nThis is a directory")
    (princ "\nThis ain't no directory")
    )
     
    Tony Tanzillo, Apr 27, 2004
    #2
  3. Joe Burke

    Joe Burke Guest

    Thank you, Tony.

    I modified movebak.lsp as follows. See my first post for the original code.

    (if (and new
    (/= "" new)
    (/= ":\\" (substr new 2))
    (/= Acet:DIRECTORY
    (logand acet:directory (acet-file-attr new))) ; TT code added here
    )
    (progn
    (princ (acet-str-format "Not a directory: %1" new))
    (setq new nil)
    )
    )

    Now it works:
    Command: movebak
    New value for MOVEBAK, or . for none <>: c:\\testfolder
    Command: movebak
    New value for MOVEBAK, or . for none <c:\\testfolder>:

    Which seems to indicate a bug. Though I'm still wondering why the problem is only
    happening on this computer.

    BTW, the virgin movebak code allowed this response: C:\\ It would put all the bak
    files at the root level of the C drive. But it would not allow any folder
    specification beyond C:\\ until your patch above.

    Joe Burke
     
    Joe Burke, Apr 27, 2004
    #3
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.