[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

File owner attribute method

Mmcolli00 Mom

3/13/2009 8:56:00 PM

I want to get the owner attribute of a file from a folder. I have not
found a class that contains a method like this. I have looked in File,
FileUtils and Ftools. Do you have a recommendation? Thanks. MC
--
Posted via http://www.ruby-....

2 Answers

matt

3/13/2009 10:49:00 PM

0

Mmcolli00 Mom <mmc_collins@yahoo.com> wrote:

> I want to get the owner attribute of a file from a folder. I have not
> found a class that contains a method like this. I have looked in File,
> FileUtils and Ftools. Do you have a recommendation?

Not sure what an "owner attribute" is, but consider File#stat, perhaps.
File::Stat#uid might be what you're looking for:

puts File.new("somefile").stat.uid #=> 501

Resolving 501 into a name is a different exercise.

m.


--
matt neuburg, phd = matt@tidbits.com, http://www.tidbits...
Leopard - http://www.takecontrolbooks.com/leopard-custom...
AppleScript - http://www.amazon.com/gp/product/...
Read TidBITS! It's free and smart. http://www.t...

Mmcolli00 Mom

3/14/2009 1:50:00 AM

0

What I mean is a file has attributes such as filename, size, modified
date, owner, author, etc... I thought that with File class having mtime,
that there must be a way to get other file attributes.
--
Posted via http://www.ruby-....