Obtaining the attributes and properties of a folder recursively.
Tim Golden
mail at timgolden.me.uk
Fri Mar 20 08:09:04 EDT 2009
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
More information about the Python-list
mailing list