diff options
author | btimby <btimby@67cdc799-7952-0410-af00-57a81ceafa0f> | 2012-04-12 03:09:23 +0000 |
---|---|---|
committer | btimby <btimby@67cdc799-7952-0410-af00-57a81ceafa0f> | 2012-04-12 03:09:23 +0000 |
commit | 5ab847e88361aefabb392b8a0f3401f7ec4f8685 (patch) | |
tree | 80b0ca8513dee7210d19539604c9dc36fc560c57 /fs/contrib | |
parent | b4f07becd1f86860f7d20e4d22e7e279085c7514 (diff) | |
download | pyfilesystem-git-5ab847e88361aefabb392b8a0f3401f7ec4f8685.tar.gz |
Fixed problem deleting an archive (also a mounted file system)
Diffstat (limited to 'fs/contrib')
-rw-r--r-- | fs/contrib/archivefs.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/contrib/archivefs.py b/fs/contrib/archivefs.py index cb6cd77..cecf36d 100644 --- a/fs/contrib/archivefs.py +++ b/fs/contrib/archivefs.py @@ -220,6 +220,15 @@ class ArchiveMountFS(mountfs.MountFS): break return super(ArchiveMountFS, self)._delegate(path) + def remove(self, path): + # In case one of our mounted file systems backing archive is being + # deleted, unmout it before continuing. Once unmounted, the archive + # can be deleted by root fs, otherwise, the ArchiveFS will be asked + # to remove itself, which it cannot do. + if self.ismount(path) and libarchive.is_archive_name(path): + self.unmount(path) + return super(ArchiveMountFS, self).remove(path) + def main(): ArchiveFS() |