realbasic-nug
[Top] [All Lists]

Re: FolderItem Issues - not 'seeing' all files

To: realbasic-nug at lists dot realsoftware dot com
Subject: Re: FolderItem Issues - not 'seeing' all files
From: syounker at bco dot com
Date: Thu, 31 Mar 2005 07:56:33 -0800
Delivered-to: realbasic-nug at lists dot realsoftware dot com
I didn't realize what a can of worms I was getting into by using
absolutepath.  My app has been working for years under OS 9 without a hitch,
but it seems now that the move to OS X is exposing problems with
absolutepath.  My file names and paths are all under 32 characters and we
are in a controlled environment so we will never have multiple volumes with
the same names.  What's happening is my function is missing groups of files
entirely while building my array.  However, its not consistent, sometimes it
gets all the files, other times it misses some.

My app needs the absolutepath to pass to an AppleScript for further
processing.  What are my alternatives?

Here is the basic loop of my code which creates an array of all the files on
a particular volume.  I store the absolute path and the total size of the
file.

BuildFileList(theFolder as folderItem)
  dim loopCounter, folderCount as integer
  
  
  folderCount=theFolder.count
  If folderCount>0 then
    For loopCounter=1 to folderCount
      if  not theFolder.item(loopCounter).directory then
        if theFolder.item(loopCounter).visible then
          
          //adds files to ComparisonFileArray
          //stores absolute path and total file size
          ComparisonFileArray.append
theFolder.item(loopCounter).absolutePath + chr(9) +
str(theFolder.item(LoopCounter).Length +
theFolder.item(LoopCounter).ResourceForkLength)
        end if
      else
        //dig deeper into folder structure
        BuildFileList(theFolder.item(loopCounter))
      end if
    Next
  End if
End sub

_______________________________________________
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>

<Prev in Thread] Current Thread [Next in Thread>