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
0dcfe8bb
Commit
0dcfe8bb
authored
Jan 19, 2010
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MountFS: fast-path copy/move/copydir/movedir if src and dst are in same FS
parent
5a016e0d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
fs/mountfs.py
+36
-0
No files found.
fs/mountfs.py
View file @
0dcfe8bb
...
@@ -229,6 +229,42 @@ class MountFS(FS):
...
@@ -229,6 +229,42 @@ class MountFS(FS):
raise
UnsupportedError
(
"rename resource"
,
path
=
src
)
raise
UnsupportedError
(
"rename resource"
,
path
=
src
)
@synchronize
@synchronize
def
move
(
self
,
src
,
dst
,
**
kwds
):
fs1
,
mount_path1
,
delegate_path1
=
self
.
_delegate
(
src
)
fs2
,
mount_path2
,
delegate_path2
=
self
.
_delegate
(
dst
)
if
fs1
is
fs2
and
fs1
is
not
self
:
fs1
.
move
(
delegate_path1
,
delegate_path2
,
**
kwds
)
else
:
super
(
MountFS
,
self
)
.
move
(
src
,
dst
,
**
kwds
)
@synchronize
def
movedir
(
self
,
src
,
dst
,
**
kwds
):
fs1
,
mount_path1
,
delegate_path1
=
self
.
_delegate
(
src
)
fs2
,
mount_path2
,
delegate_path2
=
self
.
_delegate
(
dst
)
if
fs1
is
fs2
and
fs1
is
not
self
:
fs1
.
movedir
(
delegate_path1
,
delegate_path2
,
**
kwds
)
else
:
super
(
MountFS
,
self
)
.
movedir
(
src
,
dst
,
**
kwds
)
@synchronize
def
copy
(
self
,
src
,
dst
,
**
kwds
):
fs1
,
mount_path1
,
delegate_path1
=
self
.
_delegate
(
src
)
fs2
,
mount_path2
,
delegate_path2
=
self
.
_delegate
(
dst
)
if
fs1
is
fs2
and
fs1
is
not
self
:
fs1
.
copy
(
delegate_path1
,
delegate_path2
,
**
kwds
)
else
:
super
(
MountFS
,
self
)
.
copy
(
src
,
dst
,
**
kwds
)
@synchronize
def
copydir
(
self
,
src
,
dst
,
**
kwds
):
fs1
,
mount_path1
,
delegate_path1
=
self
.
_delegate
(
src
)
fs2
,
mount_path2
,
delegate_path2
=
self
.
_delegate
(
dst
)
if
fs1
is
fs2
and
fs1
is
not
self
:
fs1
.
copydir
(
delegate_path1
,
delegate_path2
,
**
kwds
)
else
:
super
(
MountFS
,
self
)
.
copydir
(
src
,
dst
,
**
kwds
)
@synchronize
def
mountdir
(
self
,
path
,
fs
):
def
mountdir
(
self
,
path
,
fs
):
"""Mounts a host FS object on a given path.
"""Mounts a host FS object on a given 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