stat.owned? → true or false
Returns true if the effective user id of the process is the same as the owner of stat.
File.stat("testfile").owned? #=> true File.stat("/etc/passwd").owned? #=> false
Source Code
/* * call-seq: * stat.owned? => true or false * * Returns <code>true</code> if the effective user id of the process is * the same as the owner of <i>stat</i>. * * File.stat("testfile").owned? #=> true * File.stat("/etc/passwd").owned? #=> false * */ static VALUE rb_stat_owned(obj) VALUE obj; { if (get_stat(obj)->st_uid == geteuid()) return Qtrue; return Qfalse; }
<code/>and<pre/>for code samples.