开发者

Does Dir.glob guarantee the order?

开发者 https://www.devze.com 2023-03-10 05:59 出处:网络
Ruby docs don\'t mention this. Does Dir.glob(\"*\") g开发者_如何学Gouarantee the order of the files it returns, or do I need to sort them myself to be certain?No. Not if you\'re moving across OSes: h

Ruby docs don't mention this.

Does Dir.glob("*") g开发者_如何学Gouarantee the order of the files it returns, or do I need to sort them myself to be certain?


No. Not if you're moving across OSes: http://rubyforge.org/tracker/index.php?func=detail&aid=12795&group_id=426&atid=1698


If the docs don't say it, then there is no guarantee, and you need to sort it for yourself. Even if it works in your current ruby, it may not in your next.

0

精彩评论

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