Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 31 lines (21 sloc) 725 Bytes
#!/usr/bin/env python
# vim: set fileencoding=utf-8 sw=4 ts=4 et :
"""
btrfs-find-new volume generation
lists changes to volume since generation
starting point is btrfs find-new,
but modified to include directories as well.
"""
import argparse
import os
import sys
from btrfs import find_new
parser = argparse.ArgumentParser(usage=__doc__.strip())
parser.add_argument('volume', help='volume to search')
parser.add_argument(
'generation', type=int, nargs='?', default=0,
help='only show items modified at generation or a newer transaction')
opts = parser.parse_args()
volume_fd = os.open(opts.volume, os.O_DIRECTORY)
# May raise FindError, let Python print it
find_new(volume_fd, opts.generation, sys.stdout)