Compile C with some optimizations
[llpp.git] / misc / gc.py
blobd4549263cefc1282287c89e6613a818a60b392ca
1 #!/usr/bin/env python
2 import os, sys, subprocess, socket
4 fields = sys.stdin.read ().split ('\x00')
6 while len (fields) > 1:
7 opath, atime = fields[0:2]
8 fields = fields[2:]
9 npath = ""
10 if not os.path.exists (opath):
11 try:
12 npath = subprocess.check_output (
13 "locate -b -l 1 -e '/%s$'" % opath,
14 shell = False
16 except:
17 pass
18 npath = npath[:-1]
19 sys.stdout.write (opath + "\000" + npath + "\000")
20 elif os.path.isdir (opath):
21 sys.stdout.write (opath + "\000\000")
23 sys.stdout.flush ()
24 socket.fromfd (sys.stdout.fileno (),
25 socket.AF_UNIX,
26 socket.SOCK_STREAM).shutdown (socket.SHUT_RDWR)
27 sys.stderr.write ("gc.py done\n")
28 os._exit (0)