Wow! You have come a long way since I suggested using a Dictionary. I see you've gotten stuck on bundles. There are a few threads in the NUG archives that might be worth reading on this issue. It seems there can be problems...
http://support.realsoftware.com/listarchives/cgi-bin/namazu.cgi?query=Copyin g+a+program+file+through+code&idxname=realbasic-nug&whence=20 -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeffrey Ellis Sent: Saturday, March 25, 2006 6:33 PM To: REALBasic-NUG Subject: Re: List of all files and folders for a given volume Additional to this. When the failure to correctly copy a bundle occurs,and we return from the CopyFileOrFolder method, destination.LastErrorCode returns 105 (InvalidName) But again, the copying takes place nonetheless, just minus the surrounding bundle container. This is the only instance in which I¹ve seen this error occur. All My Best, Jeffrey > I am now back to having a problem with copying bundles. > > The code I'm using is from the LR, with the commented code having > corrected for a nilObject: > > Dim i as Integer > Dim newFolder as FolderItem > > If source.directory then //it's a folder > > newFolder=destination //.child(source.name) This was creating a nilObject. > newFolder.createAsFolder > > For i=1 to source.count //go through each item > If source.item(i).directory then > //it's a folder > CopyFileOrFolder source.item(i), newFolder > //recursively call this > //routine passing it the folder > else > source.item(i).CopyFileTo newFolder > //it's a file so copy it > end if > next > else //it's not a folder > source.CopyFileTo destination > end if > exception err as NilObjectException > msgbox "Some NilObject Error occurred." > > This behaves normally except when encountering a folder containing a > bundle, say an application. It is then creating the root folder, > skipping the bundle folder, and copying all the contents of the bundle > into the higher level folder. > > All My Best, > Jeffrey _______________________________________________ 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> _______________________________________________ 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>
