开发者

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.

开发者_如何学Python

Am 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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜