socket?(p1)
public
Returns true if the named file is a socket.
file_name can be an IO object.
Show source
static VALUE
rb_file_socket_p(VALUE obj, VALUE fname)
{
struct stat st;
if (rb_stat(fname, &st) < 0) return Qfalse;
if (S_ISSOCK(st.st_mode)) return Qtrue;
return Qfalse;
}