Re: file owner group names

2010-08-18 Thread Monte Goulding
 
 Thinking it over, we could build a caching mechanism and only fall back to 
 stat if we don't have the id in our cache already. 

Just what I was thinking. 

PS: ls -l on my machine doesn't truncate the user name.

Cheers

Monte

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: file owner group names

2010-08-18 Thread Andre Garzia
On Wed, Aug 18, 2010 at 2:07 AM, Jan Schenkel janschen...@yahoo.com wrote:

 The reason to avoid a shell call to stat is simple: calling it for each
 individual file in a big folder could prove an expensive operation, while a
 simple mapping method should suffice to convert 501 to janschenkel when
 you're already using the detailed files.



Jan,

But you can use a single stat command to list the property for all your
files. Using the format options for the stat call you can tailor the output
of the command to suit your needs of parsing. For example, if all you want
is group information then you can do something along the lines of:

  stat --format=%n|%U|%G list of files

for example, look at this usage scenario:

  stat --format=%n|%U|%G base.csv callgraph.dot examples.desktop

the output is:

  base.csv|agarzia|agarzia
  callgraph.dot|agarzia|agarzia
  examples.desktop|agarzia|agarzia

which is a nice parsable format using cr and pipes. First is the file name,
then the owner name, then the group name.

I think that a single stat call querying multiple files is easier than ls -l
or parsing the detailed files and then checking the /etc/ stuff.

:D



-- 
http://www.andregarzia.com All We Do Is Code.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: file owner group names

2010-08-18 Thread Jan Schenkel
--- On Tue, 8/17/10, Monte Goulding mo...@sweattechnologies.com wrote:
  
  Thinking it over, we could build a caching mechanism
 and only fall back to stat if we don't have the id in our
 cache already. 
 
 Just what I was thinking. 
 
 PS: ls -l on my machine doesn't truncate the user name.
 
 Cheers
 
 Monte
 

Well, just to wrap things up, I implemented the caching mechanism with calls to 
'stat' to fetch additional user and group names based on the uid/gid from the 
detailed files.
See: http://quartam.blogspot.com/2010/08/fun-with-detailed-files-and-stat.html

Cheers,

Jan Schenkel.
=
Quartam Reports  PDF Library for Revolution
http://www.quartam.com

=
As we grow older, we grow both wiser and more foolish at the same time.  (La 
Rochefoucauld)


  

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: file owner group names

2010-08-18 Thread Monte Goulding
Loving your work Jan and Andre.

Cheers

Monte

On 18/08/2010, at 8:22 AM, Jan Schenkel wrote:

 Hi Monte et al,
 
 What I sent earlier is only a partial solution. At work I only had our 
 Solaris server to play with; but once I got home, I found things on MacOS X 
 to be more complicated.
 See: http://quartam.blogspot.com/2010/08/fun-with-detailed-files.html
 
 Unfortunately we're not there yet for MacOS X 10.5 Leopard or 10.6 Snow 
 Leopard. So does anyone have any bright ideas?
 
 Jan Schenkel
 =
 Quartam Reports  PDF Library for Revolution
 http://www.quartam.com
 
 =
 As we grow older, we grow both wiser and more foolish at the same time.  
 (La Rochefoucauld)
 
 
 
 
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


file owner group names

2010-08-17 Thread Monte Goulding
Hi

I'm wondering if there is a way to translate the numeric owner and group 
returned in the detailed files into the actual names. At present I'm thinking 
of parsing ls -l but if there's another way to do it I'd be interested to know.

Cheers

Monte___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: file owner group names

2010-08-17 Thread Jan Schenkel
On Unix machines you can lookup 
- the name of group id by parsing the file /etc/group 
- the name of a user id by parsing the file /etc/passwd

Should be fairly straightforward to read into a variable and turn that into 
something searchable. In both files, the line delimiter is a newline character 
and the item delimiter is a colon character - and in both files the id is the 
third item.

HTH,

Jan Schenkel.
=
Quartam Reports  PDF Library for Revolution
http://www.quartam.com

=
As we grow older, we grow both wiser and more foolish at the same time.  (La 
Rochefoucauld)


--- On Tue, 8/17/10, Monte Goulding mo...@sweattechnologies.com wrote:

 From: Monte Goulding mo...@sweattechnologies.com
 Subject: file owner  group names
 To: How to use Revolution use-revolution@lists.runrev.com
 Date: Tuesday, August 17, 2010, 4:58 AM
 Hi
 
 I'm wondering if there is a way to translate the numeric
 owner and group returned in the detailed files into the
 actual names. At present I'm thinking of parsing ls -l but
 if there's another way to do it I'd be interested to know.
 
 Cheers
 
 Monte___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage
 your subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution
 


  

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: file owner group names

2010-08-17 Thread Monte Goulding
Great, cheers Jan

On 17/08/2010, at 10:40 PM, Jan Schenkel wrote:

 On Unix machines you can lookup 
 - the name of group id by parsing the file /etc/group 
 - the name of a user id by parsing the file /etc/passwd
 
 Should be fairly straightforward to read into a variable and turn that into 
 something searchable. In both files, the line delimiter is a newline 
 character and the item delimiter is a colon character - and in both files the 
 id is the third item.
 
 HTH,
 
 Jan Schenkel.
 =
 Quartam Reports  PDF Library for Revolution
 http://www.quartam.com
 
 =
 As we grow older, we grow both wiser and more foolish at the same time.  
 (La Rochefoucauld)
 
 
 --- On Tue, 8/17/10, Monte Goulding mo...@sweattechnologies.com wrote:
 
 From: Monte Goulding mo...@sweattechnologies.com
 Subject: file owner  group names
 To: How to use Revolution use-revolution@lists.runrev.com
 Date: Tuesday, August 17, 2010, 4:58 AM
 Hi
 
 I'm wondering if there is a way to translate the numeric
 owner and group returned in the detailed files into the
 actual names. At present I'm thinking of parsing ls -l but
 if there's another way to do it I'd be interested to know.
 
 Cheers
 
 Monte___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage
 your subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution
 
 
 
 
 
 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: file owner group names

2010-08-17 Thread Jan Schenkel
Hi Monte et al,

What I sent earlier is only a partial solution. At work I only had our Solaris 
server to play with; but once I got home, I found things on MacOS X to be more 
complicated.
See: http://quartam.blogspot.com/2010/08/fun-with-detailed-files.html

Unfortunately we're not there yet for MacOS X 10.5 Leopard or 10.6 Snow 
Leopard. So does anyone have any bright ideas?

Jan Schenkel
=
Quartam Reports  PDF Library for Revolution
http://www.quartam.com

=
As we grow older, we grow both wiser and more foolish at the same time.  (La 
Rochefoucauld)


  

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: file owner group names

2010-08-17 Thread Andre Garzia
On Tue, Aug 17, 2010 at 7:22 PM, Jan Schenkel janschen...@yahoo.com wrote:

 Hi Monte et al,

 What I sent earlier is only a partial solution. At work I only had our
 Solaris server to play with; but once I got home, I found things on MacOS X
 to be more complicated.
 See: http://quartam.blogspot.com/2010/08/fun-with-detailed-files.html

 Unfortunately we're not there yet for MacOS X 10.5 Leopard or 10.6 Snow
 Leopard. So does anyone have any bright ideas?


Why not use shell(stat the file) to acquire the information?




 Jan Schenkel
 =
 Quartam Reports  PDF Library for Revolution
 http://www.quartam.com

 =
 As we grow older, we grow both wiser and more foolish at the same time.
  (La Rochefoucauld)




 ___
 use-revolution mailing list
 use-revolution@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-revolution




-- 
http://www.andregarzia.com All We Do Is Code.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: file owner group names

2010-08-17 Thread Jan Schenkel
--- On Tue, 8/17/10, Andre Garzia an...@andregarzia.com wrote:

 On Tue, Aug 17, 2010 at 7:22 PM, Jan
 Schenkel janschen...@yahoo.com
 wrote:
 
  Hi Monte et al,
 
  What I sent earlier is only a partial solution. At
 work I only had our
  Solaris server to play with; but once I got home, I
 found things on MacOS X
  to be more complicated.
  See: http://quartam.blogspot.com/2010/08/fun-with-detailed-files.html
 
  Unfortunately we're not there yet for MacOS X 10.5
 Leopard or 10.6 Snow
  Leopard. So does anyone have any bright ideas?
 
 
 Why not use shell(stat the file) to acquire the
 information?
 
 

Hi Andre,

It looks like stat has the advantage over ls -l when it comes to displaying 
the complete user and group name - my user name is janschenkel which is cut 
down to 8 characters using ls -l so that's not a workable solution.

The reason to avoid a shell call to stat is simple: calling it for each 
individual file in a big folder could prove an expensive operation, while a 
simple mapping method should suffice to convert 501 to janschenkel when 
you're already using the detailed files.

Jan Schenkel.
=
Quartam Reports  PDF Library for Revolution
http://www.quartam.com

=
As we grow older, we grow both wiser and more foolish at the same time.  (La 
Rochefoucauld)


  

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: file owner group names

2010-08-17 Thread Jan Schenkel
--- On Tue, 8/17/10, I wrote before my first mug of coffee:
 --- On Tue, 8/17/10, Andre Garzia
 an...@andregarzia.com
 wrote:
  
  Why not use shell(stat the file) to acquire
 the
  information?
  
  
 
 Hi Andre,
 
 It looks like stat has the advantage over ls -l when it
 comes to displaying the complete user and group name - my
 user name is janschenkel which is cut down to 8 characters
 using ls -l so that's not a workable solution.
 
 The reason to avoid a shell call to stat is simple: calling
 it for each individual file in a big folder could prove an
 expensive operation, while a simple mapping method should
 suffice to convert 501 to janschenkel when you're already
 using the detailed files.
 

Thinking it over, we could build a caching mechanism and only fall back to 
stat if we don't have the id in our cache already. 
Poirot shall investigate :-)

Jan Schenkel.
=
Quartam Reports  PDF Library for Revolution
http://www.quartam.com

=
As we grow older, we grow both wiser and more foolish at the same time.  (La 
Rochefoucauld)


  

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution