Results 1 to 13 of 13
  1. #1
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740

    Unanswered: mkdir or equiv w/arbitrary depth of new layers

    stuck!

    i'm recursing through a network directory/subdirectories and gathering all files found into c: in a similar directory structure under c:\temp

    fine so far!

    i am using mkdir to make
    c:\temp\this
    c:\temp\this\that

    fine so far!

    but then i get a new destination more than one new subdirectory level deeper than the existing structure.
    i.e. with the existing
    c:\temp\this
    c:\temp\this\that
    i try mkdir for c:\temp\this\that\here\there\elsewhere

    not so fine anymore!
    mkdir only seems to want to add one layer of subdirectory at a time

    does fso allow muti-layer new dir? how?
    looking but i didn't find any documentation yet.

    izy

    yes i could try some more recursion with Dir(), instr( for \) and so on, but if there is a simple direct route.....
    currently using SS 2008R2

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    why swat at flies with a sledgehammer? If you're using an FSO, navigate to the immediate root folder where you want to create your new subdirectory.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    DUPLICATE - deleted!
    Last edited by izyrider; 01-25-06 at 12:39.
    currently using SS 2008R2

  4. #4
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    gulp! sorry Teddy - i don't understand what you are saying.

    meanwhile, a quick test shows
    fso.CreateFolder "c:\temp\foo\bar\this\that"
    doesn't want to go unless
    c:\temp\foo\bar\this
    already exists
    (which is not the news i wanted)

    probably i should use the existing recursion to CreateFolder in c:\temp as it finds new folders in the source.

    izy
    currently using SS 2008R2

  5. #5
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Oh, oh, I see what you're asking now. Yes, you do have to create each directory level one at a time. I misunderstood, my bad.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  6. #6
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    no worries Teddy - i included the CreateFolder stuff in the "spider" recursion and it works v. nice.

    it's now a happy little utility: spider a fileserver for file/size/modified; copy new stuff to my machine; build static HTML index page; and ftpee new stuff to the web server.

    izy
    currently using SS 2008R2

  7. #7
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    swank. trade you for a ping class?

    Maybe it's about time to get off my duff and put together that access forum code bank I've been talking about...
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  8. #8
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    no swaps, Mr. Moderator, sir.

    get that code bank fixed up on this site and i'll gladly submit the utility to celebrate the event.

    izy
    currently using SS 2008R2

  9. #9
    Join Date
    Nov 2003
    Posts
    1,487
    You wanna create non-existant multi level directories (folders) on your drives...then try this API function.

    The MakeSureDirectoryPathExists function which is supplied within the IMAGEHLP.DLL does the job.

    Suppose you want to create a folder tree that currently does not exist on one of your system drives....like say: c:\this\that\and\the\other\thing\

    Declare the DLL function within a database code module:

    Code:
    Public Declare Function MakeSureDirectoryPathExists Lib "imagehlp.dll" (ByVal lpPath As String) As Long
    Now...somewhere in your code, use the following:

    Code:
    Dim Strg
    Strg = "D:\this\that\and\the\other\thing\"
    MakeSureDirectoryPathExists Strg
    Check it with Windows Explorer....it's all there.

    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


  10. #10
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Neato!!


    what The Hell Teddy, Where's Our Code Bank?!?!?!
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  11. #11
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    neat trick CyberLynx!
    filed away for "next Time"

    meanwhile - i now bitterly regret cloning the source folder-tree on the web server: ftpeeing stuff to the server with code is fine, but any subsequent manual intervention is a royal pain!

    rewriting (dammit) now.

    short memo to self:
    keep user life simple with HTML that "fakes" folder hierachy to give the site apparent structure
    keep my life simple with flat folder structures


    izy
    currently using SS 2008R2

  12. #12
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Riiiiiiggghhhtt... nothing like a little flat-file recursion to "simplify" things...
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  13. #13
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    it does make sense Teddy, honest.
    the spider still needs to traverse the fileserver labyrinth to harvest the files, but a 50 folder structure doesn't do anything for the webserver where navigation is via "virtual" tree in HTML.
    manually navigating simultaneously thru three trees (fileserver, c:, webserver) yesterday for some interventions was a nightmare.

    anyhow - i'm happy in my confusion

    izy
    currently using SS 2008R2

Posting Permissions

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