2 import os
, sys
, subprocess
4 fields
= sys
.stdin
.read ().split ('\x00')
6 while len (fields
) > 1:
7 opath
, atime
= fields
[0:2]
9 if not os
.path
.exists (opath
):
11 npath
= subprocess
.check_output (
12 "locate -b -l 1 -e '/%s$'" % opath
,
16 sys
.stderr
.write ("removing " + opath
+ "\n")
19 sys
.stdout
.write (opath
+ "\000" + npath
+ "\000")
20 elif os
.path
.isdir (opath
):
21 sys
.stdout
.write (opath
+ "\000\000")
23 sys
.stderr
.write (sys
.argv
[0] + " done\n")