At 9:06 AM -0700 2/13/06, Tim Jones wrote:
But as I look at your message again, I'm confused -- you say you
already have code that walks through the path, creating missing
directories as you go. So you shouldn't need to be using
PathTypeShell, or any other path type for that matter -- you can
just start at the top, and give .Child one file name at a time,
can't you?
This is what seems to be eluding me...
OK, try this -- untested, but should be in the right ballpark:
Dim parts() As String = Split(tmpPath, "/")
Dim parent As FolderItem = GetFolderItem( "/" + parts(1), _
FolderItem.PathTypeShell )
parts.Remove 1
parts.Remove 0
for each part As String in parts
Dim child As FolderItem = parent.Child( part )
if not child.Exists then child.CreateAsFolder
parent = child
next
That should be it, more or less -- we start by splitting the path
into parts; note that parts(0) will be the empty string, since the
path starts with "/". The top-level item (e.g. "Volumes") is the
only thing we have to get in PathTypeShell mode, but we have to
remember to prepend the "/" that was stripped out by Split. Then
we're done with that, and we can remove it and the empty string from
our 'parts' list.
Then we simply iterate over the remaining parts, getting each one as
a child of the current parent, and creating it as a folder if it
doesn't exist.
HTH,
- Joe
--
Joseph J. Strout
[EMAIL PROTECTED]
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>