1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-09-20 20:21:55 +00:00
musix-oss/node_modules/walkdir/test/comparison/find.py

27 lines
534 B
Python
Raw Normal View History

2020-03-03 20:30:50 +00:00
import os
import sys
rootdir = sys.argv[1]
ino = {}
buf = []
for root, subFolders, files in os.walk(rootdir):
for filename in files:
filePath = os.path.join(root, filename)
try:
stat = os.lstat(filePath)
except OSError:
pass
inostr = stat.st_ino
if inostr not in ino:
ino[stat.st_ino] = 1
buf.append(filePath);
buf.append("\n");
if len(buf) >= 1024:
sys.stdout.write(''.join(buf))
buf = []
sys.stdout.write(''.join(buf));