instance method
File::Stat#file?
() -> bool
stat.file? → true or false
file.c
View on GitHub ↗
static VALUE
rb_stat_f(VALUE obj)
{
if (S_ISREG(get_stat(obj)->ST_(mode))) return Qtrue;
return Qfalse;
}
Returns true if stat is a regular file (not a device file, pipe, socket, etc.).
Example
File.stat("testfile").file? #=> true