public Method

Stat.executable_real?

stat.executable_real?     true or false

Same as executable?, but tests using the real owner of the process.

Source Code

/*
*  call-seq:
*     stat.executable_real?    => true or false
*  
*  Same as <code>executable?</code>, but tests using the real owner of
*  the process.
*/


static VALUE
rb_stat_X(obj)
   VALUE obj;
{
   struct stat *st = get_stat(obj);

#ifdef USE_GETEUID
   if (getuid() == 0) {
       return st->st_mode & S_IXUGO ? Qtrue : Qfalse;
   }
#endif
#ifdef S_IXUSR
   if (rb_stat_rowned(obj))
       return st->st_mode & S_IXUSR ? Qtrue : Qfalse;
#endif
#ifdef S_IXGRP
   if (group_member(get_stat(obj)->st_gid))
       return st->st_mode & S_IXGRP ? Qtrue : Qfalse;
#endif
#ifdef S_IXOTH
   if (!(st->st_mode & S_IXOTH)) return Qfalse;
#endif
   return Qtrue;
}
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.