Ruby Dir.glob mystery: Where are the FNM_xxx flags described?

徘徊边缘 提交于 2021-01-27 07:52:22

问题


Note: This has already been posted on Ruby Forum some weeks ago. I'm crossposting it here, because I didn't get any response so far

Dir.glob provides an optional parameter, usually referred as 'flags'. Where can I find a documentation about what flags are possible?

The Ruby 2.0 docs just say that the flags are "the same as used in File.fnmatch".

Looking up the documentation of File.fnmatch, I only find the explanation that these are the "FNM_xxx" flags, which can be or'ed together. I could however find no documentation about what FNM_xxx flags exist.

Where is this described?


回答1:


It's actually defined inside File::Constants, and thereby documented under the same.

Look it up with ri :

ri File::Constants

Or read the html doc : Module: File::Constants (Ruby 2.2.2).



来源:https://stackoverflow.com/questions/30868689/ruby-dir-glob-mystery-where-are-the-fnm-xxx-flags-described

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!