instance method
File::Stat#socket?
() -> bool
stat.socket? → true or false
file.c
View on GitHub ↗
static VALUE
rb_stat_S(VALUE obj)
{
#ifdef S_ISSOCK
if (S_ISSOCK(get_stat(obj)->ST_(mode))) return Qtrue;
#endif
return Qfalse;
}
Returns true if stat is a socket, false if it isn’t or if the operating system doesn’t support this feature.
Example
File.stat("testfile").socket? #=> false