| """umount any mounted subdirs of the given dir, but not that dir.""" |
| code = int(match.group(1), 8) |
| return re.sub(r'\\(\d\d\d)', OctalToChr, s) |
| sys.stderr.write('usage: %s <dirname>\n' % sys.argv[0]) |
| realwhichdir = os.getcwd() |
| whichparts = tuple(realwhichdir.split('/')) |
| for line in open('/proc/mounts').readlines(): |
| dev, path, junk = line.split(' ', 2) |
| fixpath = ReplaceOctals(path) |
| parts = tuple(fixpath.split('/')) |
| if parts[:len(whichparts)] == whichparts and parts != whichparts: |
| for parts in reversed(sorted(do_dirs)): |
| dirname = '/'.join(parts) |
| sys.stderr.write('umount %r\n' % dirname) |
| if os.spawnvp(os.P_WAIT, 'umount', ['umount', dirname]): |
| if __name__ == '__main__': |