1 #!/usr/local/bin/python3.0
10 if not os.path.exists("data/05"):
11 os.makedirs("data/05")
13 treg = re.compile("data/04/[0-9a-f]{2,2}/[0-9a-f]{32,32}/([0-9a-f]{32,32})")
15 for path, dirs, files in os.walk("data/04"):
17 tfile = os.path.join(path, file)
18 match = treg.match(tfile)
20 datafiles[match.group(1)] = tfile
21 print("Datafiles isolated: %d" % len(datafiles))
24 for path, dirs, files in os.walk("data/05"):
25 colfiles.update({file:os.path.join(path, file) for file in files})
26 print("Colfiles isolated: %d" % len(colfiles))
29 touchfiles = sorted(set([tag for tag in colfiles.keys()]) | set([tag for tag in datafiles.keys()]))
32 for tag in touchfiles:
33 assert(tag in datafiles)
34 if not tag in colfiles:
35 print("Linking %s" % tag)
36 if not os.path.exists("data/05/%s" % (tag[0:2])):
37 os.makedirs("data/05/%s" % (tag[0:2]))
38 os.link(datafiles[tag], "data/05/%s/%s" % (tag[0:2], tag))