开发者

Ruby Dir.glob works on laptop not on desktop?

开发者 https://www.devze.com 2022-12-29 07:11 出处:网络
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.

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

精彩评论

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