socket?()
public
Returns true if stat is a socket, false if it isn’t or if the
operating system doesn’t support this feature.
File.stat("testfile").socket?
Show source
/*
* call-seq:
* stat.socket? => true or false
*
* Returns <code>true</code> if <i>stat</i> is a socket,
* <code>false</code> if it isn't or if the operating system doesn't
* support this feature.
*
* File.stat("testfile").socket?
*
*/
static VALUE
rb_stat_S(obj)
VALUE obj;
{
#ifdef S_ISSOCK
if (S_ISSOCK(get_stat(obj)->st_mode)) return Qtrue;
#endif
return Qfalse;
}