diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2013-08-13 11:08:17 +0100 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2013-08-15 15:25:04 +0000 |
commit | e59ade699e91764ae02d63b853ae7f3bc6c1c3d4 (patch) | |
tree | 75ee80beaa36dcc41b58f549095480096bd359f6 /.gitignore | |
parent | 2d11c3d82fb869197da5ffa12635e125a380e48f (diff) | |
download | morph-e59ade699e91764ae02d63b853ae7f3bc6c1c3d4.tar.gz |
fsutils: add invert_paths function
This will list all the paths generated by the walker generator function
that aren't in the specified set.
It removes directories from those returned by the walker, since with
os.walk(topdown=True) this culls the search space.
In the set of provided paths and the set of returned paths, if a directory
is given, then its contents are virtually part of the set.
This oddly specific behaviour is because invert_paths is to be used
with linux-user-chroot to mark subtrees as read-only, when it only
has a set of paths it wants to keep writable.
It takes a walker, rather than being given a path and using os.walk, so
that it is a pure function, so is easier to unit test.
Diffstat (limited to '.gitignore')
0 files changed, 0 insertions, 0 deletions