Deep Space

Wouter wouter.abraham at pi.be
Tue Sep 9 22:28:00 EDT 2003


On Wednesday, Sep 10, 2003, at 01:24 Europe/Brussels, Wouter wrote:

Hi,
Last post, too much midnight oil again
Big mistake, pasted a intermediary script. Terribly sorry.
Hope I got it right now.
Good night,
WA

> on mouseUp
>   put empty into field "result"
>   answer folder "Pick a folder you want to walk:"
>   if it is empty then exit mouseUp
>   if last char of it <> "/" then put "/" after it
>   put walkDir(it) into field "result"
> end mouseUp
>
> -- This recursive function expects a folder path.
> -- It returns a file list for that folder and for each
> --  sub-folder it contains (pre-order search)
> -- Invisible files are excluded.
>
> function walkDir dirPath
>   #### to have something to read while waiting
>   put  dirPath
>   -- add 1 to isDepth
>   -- if isDepth > limitDepth then
>   -- put isDepth into limitDepth
>   -- put limitDepth
>   -- end if
>   put empty into tList
>   set defaultFolder to dirPath
>   -- Dar's discovery. Check permissions were ok
>   get the Result
>   if it is not empty then
>     -- subtract 1 from isDepth
>     return empty
>   end if
>   put the long files into fList
>   ### instead of the if statement in the repeat loop
>   filter fList with "[!.]*"
>   repeat for each line fLine in fList
>     put  dirPath & item 1 of fLine & comma & last item of fLine & 
> return after tList
>   end repeat
>   #### change to eliminate the aliases
>   get shell("ls -F")
>   filter it with "*[/]"
>   #### shell() returns í for ƒ used in some cases to
>   #### designate a folder
>   replace "í" with "ƒ" in it   -- added
>   set the itemDel to "/"
>   #### to eliminate the apps -- changed
>   #### comment out if not needed
  repeat for each line x in it
     if x = "Contents/" then
       set the directory to dirpath & x
       put the folders into a
       if  "Resources" is in a and "MacOS" is in a  then
         put  char 1 to -2 of dirPath & return after tList
         next repeat
       end if
     end if
     put walkDir(dirPath & x) after tList
   end repeat
>   -- subtract 1 from isDepth
>   return tList
> end walkDir
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 2193 bytes
Desc: not available
URL: <http://lists.runrev.com/pipermail/use-livecode/attachments/20030909/29204769/attachment.bin>


More information about the use-livecode mailing list