blob: ef920e934765415e8590dab1890504cdcd2b4987 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
import os
import os.path
for (dirpath, dirnames, filenames) in os.walk('/home/cat/proj/sqlpython/sqlpython'):
for fname in filenames:
fullfilename = os.path.join(dirpath, fname)
stats = os.stat(fullfilename)
binds['path'] = dirpath
binds['name'] = fname
binds['bytes'] = stats.st_size
cmd("""INSERT INTO cat.files (path, name, bytes)
VALUES (%(path)s, %(name)s, %(bytes)s)""")
quit()
|