static public Method

File.grpowned?(p1)

File.grpowned?(file_name)    true or false

Returns true if the named file exists and the effective group id of the calling process is the owner of the file. Returns false on Windows.

Source Code

/*
* call-seq:
*    File.grpowned?(file_name)   => true or false
*
* Returns <code>true</code> if the named file exists and the
* effective group id of the calling process is the owner of
* the file. Returns <code>false</code> on Windows.
*/

static VALUE
test_grpowned(obj, fname)
   VALUE obj, fname;
{
#ifndef _WIN32
   struct stat st;

   if (rb_stat(fname, &st) < 0) return Qfalse;
   if (group_member(st.st_gid)) 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.