aboutsummaryrefslogtreecommitdiff
path: root/node_modules/walkdir/test/comparison/find.py
blob: 526d6941f226d54a00f968347294fdd541f42f10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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));