I'm curious as to how this performs on people's home folders.
Like the intitial offerings in this thread, I find this runs but doesn't return within 2 minutes (in fact, I let it run for 9 minutes and it stil didn't return; fans, of course, were maxing out at 6200rpm).
Admittedly that's on a reasonably old mac (2009 MBP), but with 8GB RAM and a two-disk internal "Fusion" drive (125GB SSD and 750GB, 7200rpm platter). The combined drive is 50% free and the home folder, if Finder is to be believed, is 370GB.
I know that's a lot of work, but I'd still expect anything usable to return within a couple of minutes, especially given the relative speed of using ls -R by comparison. Unlike Shane, my laziness has thus far got the better of me in terms of trying to improve the formatting of the shell script option. If I get the chance over the weekend I'll have a go at it, unless others report this script returns the home folder in reasonable time (in which case perhaps I have a local issue that's causing the problem).
I wouldn't be surprised to see it go over 2 minutes -- it's up to 28 seconds here with the latest version, for only 135GB -- but 9 sounds crazy. RAM probably makes a lot of difference because it's used for directory caching, but that shouldn't favor any particular method.
use scripting additions
use framework "Foundation"
-- this where we'll store the stuff as we collect it; we could use a list, but it could get very long
set finalNSArray to current application's NSMutableArray's array()
-- make NSURL of where to start
set thePath to POSIX path of (path to home folder)
set time1 to current date
do shell script ("ls -R " & quoted form of thePath)
set time2 to current date
set anNSURL to current application's |NSURL|'s fileURLWithPath:thePath
-- call our handler
my listURL:anNSURL inArray:finalNSArray
-- join the strings in the array, and convert it to an AS string
(finalNSArray's componentsJoinedByString:linefeed) as text
set time3 to current date
return {time2 - time1, time3 - time2}