Ruby Dir.glob works on laptop not on desktop?
I have a ruby shell script that works perfectly on my laptop, but Dir.glob doesn't seem to work when I try and run it on my desktop.
Here is the code:
sFileTemplate = File.join("**", sResolutions, "**", "*."+sType)
sFiles = Dir.glob(sFileTemplate)
Both machines run OSX 10.5 and are running ruby -v 1.9.1.
开发者_如何学PythonAm I calling glob wrong?
Thanks
I would suggest using the Ruby debug option and/or run with ktrace and try to figure out the difference.
$ ruby -rdebug problem.rb data.txt
Are you sure you have the exact same files in both locations? I haven't dug up the API on Dir.glob, but are you handling .. and . properly?
精彩评论