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

## Question:

Tag: ruby

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?

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).

# Related:

## How to flatten a structure of embedded Set and Hash

ruby,recursion
I would like to convert an embedding structure into a flat one. An embedding structure is a set of 0 or more objects, such as: a string or a hash having some string as key and some other embedding structure as value. A flat structure is a set of arrays...

## Saying there are 0 arguments when I have 2? Trying to open a CSV file to write into

ruby,file,csv,dir
I'm trying to read from a CSV file and codify people into groups using an equation. I append the name of their group they fall into to the end of the array that their row creates. Then I write it to a new file so I don't overwrite the original...

## Can't map a range of dates in Ruby/Rails

ruby-on-rails,ruby
I'm trying to map a range of dates and pass them to my view as an array, as follows: from, to = Date.parse("2014-01-01"), Date.yesterday date_range = (from..to) @mapped_dates = date_range.map {|date| date.strftime("%b %e")} I reference them in some JS in my view as follows: dateLabels = <%= raw @mapped_dates.to_json %>;...

ruby