At 3:05 PM -0700 2/12/06, Tim Jones wrote:

I always get the "UnsupportedFormatException" error when I get to the path
element that doesn't exist.

If I recall correctly, the OS X routines that are based on paths can't represent files that don't exist. To do what you want, you would need to strip off the last part of the path, GetFolderItem on that, then call .Child to get a reference to the nonexistent file.

Note that this code:

  f1 = GetFolderItem(tmpPath, FolderItem.PathTypeShell)     // (1)
  if f1 = Nil Then
    Debug.Print "f1 is Nil, creating folder"
    f1 = New FolderItem(tmpPath, FolderItem.PathTypeShell)  // (2)

is a bit nonsensical, since GetFolderItem and New FolderItem do exactly the same thing, except that the latter raises an exception to indicate failure while the former returns Nil. So if you failed at point (1), it will always be fruitless to try again in form (2).

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?

Best,
- 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>

Reply via email to