APIdock / Ruby
/
method

readable_real?

ruby latest stable - Class: File ::Stat
readable_real?()
public

Returns true if stat is readable by the real user id of this process.

File .stat("testfile").readable_real?  #=> true
static VALUE
rb_stat_R(VALUE obj)
{
 struct stat *st = get_stat(obj);
#ifdef USE_GETEUID
 if (getuid() == 0) return Qtrue;
#endif
#ifdef S_IRUSR
 if (rb_stat_rowned(obj))
 return st->st_mode & S_IRUSR ? Qtrue : Qfalse;
#endif
#ifdef S_IRGRP
 if (rb_group_member(get_stat(obj)->st_gid))
 return st->st_mode & S_IRGRP ? Qtrue : Qfalse;
#endif
#ifdef S_IROTH
 if (!(st->st_mode & S_IROTH)) return Qfalse;
#endif
 return Qtrue;
}

AltStyle によって変換されたページ (->オリジナル) /