File System Scan
Project description
fsdir:2012-03-26:v0.7:Test with Python2.6 and Python2.7
::
This is a simple, but handy module written in C, this module do a recursive walk returning file and folder information for Linux systems.
The module is in source form and was tested with python2.6 and python2.7.
To install the module after download execute.
#python setup.py install
Summary mode now match the "du" speed :)
The version 0.7
- Add crc32 hash, so we can check for duplicated files :)
- Bug hunting
- Better error handling
- Disable the id to string for the username too "expensive".
- Symlinks, FIFO, Socket are ignored.
PS:This module calculate the size in disk not the size of the file.
Example:
Summary off.
>>>import fsdir
>>>fsdir.go(".",False)
[{'permGroup': 'rwx', 'permOwner': 'rwx', 'permOthers': 'rwx', 'Owner': 'rgomes', 'Path': '.', 'Type': 'D', 'Size': 0},#Dir dont return a CRC hash
{'permGroup': 'rwx', 'permOwner': 'rwx', 'permOthers': 'rwx', 'Owner': 'rgomes', 'Path': './fsdir.so', 'CRC32': 1086464254, 'Type': 'F', 'Size': 28}]
Summary On.
>>>import fsdir
>>>fsdir.go(".",True) #or fsdir.go(".") summary mode is On by default,
[{'Dirs': 1, 'Files': 2, 'Size': 28}]
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
list[x]["Owner"]=numeric id
list[x]["Path"]=Path to the file/dir
list[x]["Type"]=F|D (F=File, D=Directory)
list[x]["Size"]=Size in Kilobytes
::
This is a simple, but handy module written in C, this module do a recursive walk returning file and folder information for Linux systems.
The module is in source form and was tested with python2.6 and python2.7.
To install the module after download execute.
#python setup.py install
Summary mode now match the "du" speed :)
The version 0.7
- Add crc32 hash, so we can check for duplicated files :)
- Bug hunting
- Better error handling
- Disable the id to string for the username too "expensive".
- Symlinks, FIFO, Socket are ignored.
PS:This module calculate the size in disk not the size of the file.
Example:
Summary off.
>>>import fsdir
>>>fsdir.go(".",False)
[{'permGroup': 'rwx', 'permOwner': 'rwx', 'permOthers': 'rwx', 'Owner': 'rgomes', 'Path': '.', 'Type': 'D', 'Size': 0},#Dir dont return a CRC hash
{'permGroup': 'rwx', 'permOwner': 'rwx', 'permOthers': 'rwx', 'Owner': 'rgomes', 'Path': './fsdir.so', 'CRC32': 1086464254, 'Type': 'F', 'Size': 28}]
Summary On.
>>>import fsdir
>>>fsdir.go(".",True) #or fsdir.go(".") summary mode is On by default,
[{'Dirs': 1, 'Files': 2, 'Size': 28}]
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
list[x]["Owner"]=numeric id
list[x]["Path"]=Path to the file/dir
list[x]["Type"]=F|D (F=File, D=Directory)
list[x]["Size"]=Size in Kilobytes
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fsdir-0.7.tar.gz
(5.3 kB
view hashes)