chardev?(p1)
public
Returns true if the named file is a character device.
Show source
static VALUE
rb_file_chardev_p(VALUE obj, VALUE fname)
{
struct stat st;
if (rb_stat(fname, &st) < 0) return Qfalse;
if (S_ISCHR(st.st_mode)) return Qtrue;
return Qfalse;
}