Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class method

File.pipe?

(::path | ::IO file_name) -> bool
File.pipe?(path) → true or false

Returns whether the entry at the given path is a pipe:

Example
File.pipe?('doc/syntax/')        # => false  # Directory.
File.pipe?('doc/maintainers.md') # => false  # Regular file.
File.pipe?('nosuch')             # => false  # Non-existent.
path = '/tmp/foo'
File.mkfifo(path)
File.pipe?(path)                 # => true
File.delete(path)                # Clean up.
See also .path .readable? .owned? .readable_real? also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0