Results 1 to 6 of 6

Thread: Find a directory

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    85

    Question

    In my code I need to be able to search for a directory to find out if it is created or not and if not then I need to create it. The create part is not a problem. I have been fighting with this for a couple of days now and I'm getting nowhere. Thanks for the help.

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    Code:
    If Dir$("c:\myDir", vbDirectory) <> "" Then
      'the dir exists
    else
      'it doesn't
    End if
    Iain, thats with an i by the way!

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    85
    Thank you very much. Will this code search down into subdirectories??

  4. #4
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    No. It will tell you if a directory exists at the exact location specified.

    if you ask for "C:\mydir" or "C:\myDir\AnotherDir" then it will tell you if that exists. It will not tell you if mydir exists anywhere else.
    Iain, thats with an i by the way!

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    85

    Cool

    Kedaman thanks for the information. I'm going to try it out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width