Find.find reversed order on MacOSX Snow Leopard

R

Raphaël Marmier

Hi all,

I just found out that the following code yields the directory listing in
reverse alphanumerical order on Snow Leopard (10.6.1). This is with the
out-of-the-box ruby install.

require 'find'
Find.find '/Library/Preferences/' do |x| puts x end

On MacOSX 10.5 Leopard, it yielded the listing in either default system
order, or alphanumerical order, I don't remember.

Is it expected behaviour and what can I do to restore the previous one?

thanks
Raphaël
 
P

Patrick Okui

Hi all,

I just found out that the following code yields the directory =20
listing in
reverse alphanumerical order on Snow Leopard (10.6.1). This is with =20=
the
out-of-the-box ruby install.

require 'find'
Find.find '/Library/Preferences/' do |x| puts x end

On MacOSX 10.5 Leopard, it yielded the listing in either default =20
system
order, or alphanumerical order, I don't remember.

Just tried that on 10.5 and it still gives reverse alphanumerical order.

[pokui@mbp-pjo:~]$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.5.8
BuildVersion: 9L30
[pokui@mbp-pjo:~]$ ruby -r 'find' -e 'Find.find "/Library/=20
Preferences/" do |x| puts x end'
/Library/Preferences/
/Library/Preferences/SystemConfiguration
...
...
...
/Library/Preferences/com.apple.AppleFileServer.plist
/Library/Preferences/com.apple.alf.plist
/Library/Preferences/com.apple.AirPortBaseStationAgent.launchd
/Library/Preferences/.GlobalPreferences.plist
[pokui@mbp-pjo:~]$=20=
 
R

Raphaël Marmier

I understand now that any sort performed on a find() would delay it
until directory traversal is complete.

Thanks for your answers.

Raphaël
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top