instance method
File::Stat#chardev?
() -> bool
stat.chardev? → true or false
file.c
View on GitHub ↗
static VALUE
rb_stat_c(VALUE obj)
{
if (S_ISCHR(get_stat(obj)->ST_(mode))) return Qtrue;
return Qfalse;
}
Returns true if the file is a character device, false if it isn’t or if the operating system doesn’t support this feature.
Example
File.stat("/dev/tty").chardev? #=> true