Skip to content
instance method

FileTest#chardev?

(::path | ::io file_name) -> bool
File.chardev?(filepath) → true or false

Returns true if filepath points to a character device, false otherwise.

Example
File.chardev?($stdin)     # => true
File.chardev?('t.txt')     # => false
See also #blockdev? #directory? #empty? also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0