How to create a directory with vlisp?

Discussion in 'AutoCAD' started by Gary McMaster, Dec 18, 2003.

  1. Hi Everyone,

    I've found all kinds of file handling functions in the vlisp documentation
    but I don't see any directory handling functions
    Is it possible to check for and/or create a directory from lisp? Can anyone
    provide a sample of how this is done if it is possible?

    Thanks in advance.

    Gary
     
    Gary McMaster, Dec 18, 2003
    #1
  2. Gary McMaster

    Steve Jones Guest

    Gary

    (vl-mkdir "YourFolderPath")

    Steve
     
    Steve Jones, Dec 18, 2003
    #2
  3. Thanks very much Steve.

    I thought I had seen a way to handle dirs in the Acad2000 docs.

    Would it be (vl-chkdir "YourFolderPath") to see if it already exists?

    Gary
     
    Gary McMaster, Dec 18, 2003
    #3
  4. Gary McMaster

    Steve Jones Guest

    Gary,

    Use (filefind), example below

    (if
    (not (findfile "YourFolderPath"))
    (vl-mkdir "YourFolderPath")
    (alert "Folder exists")
    )

    Steve
     
    Steve Jones, Dec 18, 2003
    #4
  5. Gary McMaster

    Steve Jones Guest

    That should be use (findfile)...


     
    Steve Jones, Dec 18, 2003
    #5
  6. Steve,

    Thanks again.

    I'm familiar with findfile but never thought of using it to find a
    directory.
    Probably because I've never created a directory with lisp:)

    Gary
     
    Gary McMaster, Dec 18, 2003
    #6
  7. You could use vl-file-directory-p
     
    Jason Piercey, Dec 18, 2003
    #7
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.