logo       

Re: Adding a directory to a folderitem?: msg#03022

lang.realbasic.user

Subject: Re: Adding a directory to a folderitem?

Dim f2 as folderitem
f2 = GetFolderItem(f1.absolutepath + delimeter + SubfolderName)

Thank you for providing an example that so thoroughly displays what *not* to do! :-)

There are several problems with this. First, on the Mac, absolute paths are extremely unreliable. This is, in part, due to the fact that multiple volumes can have the same name, making it possible for two files to have the same path.

Second, the delimiter is different on Mac and Windows, so you have to add platform-specific code to set the delimiter.

Third, this method involves breaking down a FolderItem into a string path, modifying the string, then parsing it into a new FolderItem. This is not a quick process, comparatively.

Use the Child method instead, as others have posted.
--

-Thomas

Personal web page: http://homepage.mac.com/thomasareed/
My shareware: http://www.bitjuggler.com/
REALbasic page: http://www.bitjuggler.com/extra/

There are 10 kinds of people in the world -- those who understand binary
numbers and those who don't.

- - -
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise