public Method

Stat.socket?

stat.socket?     true or false

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?   #=> false

Source Code

/*
*  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?   #=> false
*     
*/

static VALUE
rb_stat_S(obj)
   VALUE obj;
{
#ifdef S_ISSOCK
   if (S_ISSOCK(get_stat(obj)->st_mode)) return Qtrue;

#endif
   return Qfalse;
}
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.