Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

Dir#fileno

fileno → integer

Returns the file descriptor used in dir.

Example
d = Dir.new('..')
d.fileno # => 8

This method uses the dirfd() function defined by POSIX 2008; the method is not implemented on non-POSIX platforms (raises NotImplementedError).

See also #each_child #inspect #each #path also in 4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0