try thisrequire 'etc'
uid = File.stat('testfile').uid
puts 'Owner name: ', Etc.getpwuid(uid).nameOn Tue, Mar 17, 2015 at 11:52 AM, Medya < " target="_blank"> > wrote:Aj, that is only for UID, that means I means I have to find out another way to find out Uid of a username which I couldn't find in ruby librariesOn Fri, Mar 13, 2015 at 6:18 PM, AJ Christensen < " target="_blank"> > wrote:Hi Medya,
You can use File::Stat#uid
http://ruby-doc.org/core-2.2.1/File/Stat.html#method-i-uid
Please consider searching before sending questions like this to the
mailing list :-)
cheers,
--aj
On Sat, Mar 14, 2015 at 12:01 PM, Medya < " target="_blank"> > wrote:
> how can I add a guard to a folder that says
> run only_if the owner of /blahblah/ folder is medya ?
Archive powered by MHonArc 2.6.16.