Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pyfs
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pyfs
Commits
73aecc22
Commit
73aecc22
authored
Apr 17, 2012
by
btimby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Need to do delete directly rather than allowing it to be delegated
parent
40fca850
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
fs/contrib/archivefs.py
+8
-3
No files found.
fs/contrib/archivefs.py
View file @
73aecc22
...
...
@@ -192,9 +192,10 @@ class ArchiveFS(FS):
class
ArchiveMountFS
(
mountfs
.
MountFS
):
'''A subclass of MountFS that automatically identifies archives. Once identified
archives are mounted in place of the archive file.'''
def
__init__
(
self
,
root
,
**
kwargs
):
def
__init__
(
self
,
root
fs
,
**
kwargs
):
super
(
ArchiveMountFS
,
self
)
.
__init__
(
**
kwargs
)
self
.
mountdir
(
'/'
,
root
)
self
.
rootfs
=
rootfs
self
.
mountdir
(
'/'
,
rootfs
)
def
ismount
(
self
,
path
):
try
:
...
...
@@ -210,7 +211,7 @@ class ArchiveMountFS(mountfs.MountFS):
break
if
libarchive
.
is_archive_name
(
ppath
):
# It looks like an archive, try mounting it.
full_path
=
self
.
mount_tree
[
'/'
]
.
fs
.
getsyspath
(
ppath
)
full_path
=
self
.
root
fs
.
getsyspath
(
ppath
)
try
:
self
.
mountdir
(
ppath
,
ArchiveFS
(
full_path
,
'r'
))
except
:
...
...
@@ -227,6 +228,10 @@ class ArchiveMountFS(mountfs.MountFS):
# to remove itself, which it cannot do.
if
self
.
ismount
(
path
)
and
libarchive
.
is_archive_name
(
path
):
self
.
unmount
(
path
)
# Send the delete directoy to the root filesystem. This avoids
# being delegated, and the fs we just unmounted being remounted.
return
self
.
rootfs
.
remove
(
path
)
# Otherwise, just delegate to the responsible fs.
return
super
(
ArchiveMountFS
,
self
)
.
remove
(
path
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment