Obtaining the attributes and properties of a folder recursively.

venutaurus539 at gmail.com venutaurus539 at gmail.com
Fri Mar 20 09:27:02 EDT 2009


On Mar 20, 5:09 pm, Tim Golden <m... at timgolden.me.uk> wrote:
> Tino Wildenhain wrote:
> > Tim Golden wrote:
> > ...
> >> and do the following:
>
> >> <code>
> >> from winsys import fs
>
> >> for f in fs.flat ("c:/temp"):
> >>  f.dump ()
> >          ^ eeek!
>
> Was the eeeek! for the space before the bracket
> (which, for some unaccountable reason disturbs
> some people)? Or for the idea of dumping data
> out?
>
> This is what it looks like for one (random) file:
>
> <dump>
> Python 2.6.1 (r261:67517, Dec  4 2008, 16:51:00) [MSC
> Type "help", "copyright", "credits" or "license" for>>> from winsys import fs
> >>> fs.file ("c:/temp/t.py").dump ()
>
> {
>   c:\temp\t.py
>   {
>     c:\temp\t.py
>     parts: [u'\\\\?\\c:\\', u'temp', u't.py']
>     root: \\?\c:\
>     dirname: \temp
>     path: \\?\c:\\temp
>     filename: t.py
>     parent: \\?\c:\temp
>   }
>   readable: True
>   id: 260191347677670224354611
>   n_links: 1
>   created_at: 2008-10-27 09:45:09
>   accessed_at: 2009-03-20 08:57:25
>   written_at: 2009-03-20 08:57:25
>   uncompressed_size: 1170
>   size: 1170
>   Attributes:
>   {
>     ARCHIVE => True
>     COMPRESSED => False
>     DIRECTORY => False
>     ENCRYPTED => False
>     HIDDEN => False
>     NORMAL => False
>     NOT_CONTENT_INDEXES => False
>     OFFLINE => False
>     READONLY => False
>     REPARSE_POINT => False
>     SPARSE_FILE => False
>     SYSTEM => False
>     TEMPORARY => False
>     VIRTUAL => False
>   }
>   Security:
>   control:
>   {
>     DACL_AUTO_INHERITED
>     SELF_RELATIVE
>     DACL_PRESENT
>   }
>   owner: VOUK\goldent
>   dacl:
>   {
>     inherited: True
>     {
>       trustee: VOUK\goldent
>       access: 00000000000011111000000011111111
>       type: ACCESS_ALLOWED
>     }
>     {
>       trustee: BUILTIN\Administrators
>       access: 00000000000011111000000011111111
>       type: ACCESS_ALLOWED
>       flags:
>       {
>         INHERITED
>       }
>     }
>     {
>       trustee: NT AUTHORITY\SYSTEM
>       access: 00000000000011111000000011111111
>       type: ACCESS_ALLOWED
>       flags:
>       {
>         INHERITED
>       }
>     }
>     {
>       trustee: VOUK\goldent
>       access: 00000000000011111000000011111111
>       type: ACCESS_ALLOWED
>       flags:
>       {
>         INHERITED
>       }
>     }
>     {
>       trustee: BUILTIN\Users
>       access: 00000000000010010000000001010100
>       type: ACCESS_ALLOWED
>       flags:
>       {
>         INHERITED
>       }
>     }
>   }}
>
> </dump>
>
> TJG

Thank you for your suggestion but.. I'll have around 1000 such files
in the whole directory and it becomes hard to manage such output
because again I've to take this snapshot before backing up the data
and have to do the same and compare both when the data gets restored,
just to verify whether the restore happened successfully or not.
Thank you,
Venu Madhav



More information about the Python-list mailing list