class method
File.owned?
(::string | ::_ToPath | ::IO file_name) -> bool
File.owned?(file_name) → true or false
file.c
View on GitHub ↗
static VALUE
rb_file_owned_p(VALUE obj, VALUE fname)
{
struct stat st;
if (rb_stat(fname, &st) < 0) return Qfalse;
return RBOOL(st.st_uid == geteuid());
}
Returns true if the named file exists and the effective user id of the calling process is the owner of the file.
file_name can be an IO object.