skip to navigation
skip to content

fsdir 0.8

File System Scan

Package Documentation

Latest Version: 0.8.4

This is a simple, but handy module,
do a recursive walk returning file and folder information. But with much better performance then os.walk.

Current version 0.8

PS:This module calculate the size in disk not the size of the file.

== Usage:==
===fsdir.go(path='The path',summary=[True|False], crc32=[True|False])===
#The true/false flag enable or disable the summary and crc32 mode

== Example: ==
=== Summary off, CRC32 off ===
>>>import fsdir
>>> fsdir.go(path=".")
[{'permGroup': 'rwx', 'permOwner': 'rwx', 'permOthers': 'r-x', 'Owner': 1000, 'Path': '.', 'Type': 'D', 'Size': 4}, {'permGroup': 'rwx', 'permOwner': 'rwx', 'permOthers': 'r-x', 'Owner': 1000, 'Path': './', 'Type': 'F', 'Size': 40}]

=== Summary off, CRC32 On ===
[{'permGroup': 'rwx', 'permOwner': 'rwx', 'permOthers': 'r-x', 'Owner': 1000, 'Path': '.', 'Type': 'D', 'Size': 4}, #Directory's never return CRC32
{'permGroup': 'rwx', 'CRC32': 2117939917, 'permOwner': 'rwx', 'permOthers': 'r-x', 'Owner': 1000, 'Path': './', 'Type': 'F', 'Size': 40}]

=== Summary On. ===
>>>import fsdir
>>> fsdir.go(path=".",summary=True)#Summary is off by default.
[{'Dirs': 1, 'Files': 1, 'Size': 44}]

Note: Permission always return 3 char string.
"rwx" If the premession is active or - if is not:
Example a file just with read permission will be "r--"

=== where: ===
*list[x]["permGroup"]=Permission to the Group
*list[x]["permOwner"]=Permission to the Owner
*list[x]["permOthers"]=Permission to the Others
*list[x]["CRC32"]=CRC32 hash #If crc32 flag true
*list[x]["Owner"]=numeric id
*list[x]["Path"]=Full Path to the file/dir
*list[x]["Type"]=F|D (F=File, D=Directory)
*list[x]["Size"]=Size in Kilobytes
File Type Py Version Uploaded on Size
fsdir-0.8.tar.gz (md5) Source 2012-12-03 5KB