Sorry...

---------- Forwarded message ----------
From: Stephen Nelson-Smith <[EMAIL PROTECTED]>
Date: Oct 8, 2007 6:54 PM
Subject: Re: [Tutor] Permission Report
To: Alan Gauld <[EMAIL PROTECTED]>


On 10/8/07, Alan Gauld <[EMAIL PROTECTED]> wrote:

> Yes, os.walk and os.stat should do what you want.

Ok - I have:

import os, stat
permissions = {}

for dir, base, files in os.walk('/home/peter/third/accounts/'):
  for f in files:
    file = os.path.join(dir, f)
    perm = os.stat(file)[stat.ST_MODE]
    permissions[file] = oct(stat.S_IMODE(perm))

This is fine - it stores the info I need.

But if I want to run the same procedure on a remote host, and store
the results in a dictionary so they can be compared, what would I do?

S.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to