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
f5dfa021
Commit
f5dfa021
authored
Nov 26, 2009
by
willmcgugan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issue with using copydir to copy to the root of a memoryfs
parent
13406444
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
5 deletions
+20
-5
fs/base.py
+1
-0
fs/memoryfs.py
+1
-1
fs/mountfs.py
+2
-0
fs/path.py
+4
-0
fs/utils.py
+12
-4
No files found.
fs/base.py
View file @
f5dfa021
...
...
@@ -668,6 +668,7 @@ class FS(object):
copyfile
=
self
.
copy
copyfile
=
self
.
copy
if
dst
:
self
.
makedir
(
dst
,
allow_recreate
=
overwrite
)
for
dirname
,
filenames
in
self
.
walk
(
src
):
...
...
fs/memoryfs.py
View file @
f5dfa021
...
...
@@ -227,7 +227,7 @@ class MemoryFS(FS):
@synchronize
def
makedir
(
self
,
dirname
,
recursive
=
False
,
allow_recreate
=
False
):
if
not
dirname
:
raise
PathError
(
""
,
"Path is empty"
)
raise
PathError
(
dirname
)
fullpath
=
dirname
dirpath
,
dirname
=
pathsplit
(
dirname
)
...
...
fs/mountfs.py
View file @
f5dfa021
...
...
@@ -126,6 +126,8 @@ class MountFS(FS):
fs
,
mount_path
,
delegate_path
=
self
.
_delegate
(
path
)
if
fs
is
self
:
raise
UnsupportedError
(
"make directory"
,
msg
=
"Can only makedir for mounted paths"
)
if
not
delegate_path
:
return
True
return
fs
.
makedir
(
delegate_path
,
recursive
=
recursive
,
allow_recreate
=
allow_recreate
)
@synchronize
...
...
fs/path.py
View file @
f5dfa021
...
...
@@ -202,3 +202,7 @@ def isprefix(path1,path2):
return
False
return
True
def
forcedir
(
path
):
if
not
path
.
endswith
(
'/'
):
return
path
+
'/'
return
path
fs/utils.py
View file @
f5dfa021
...
...
@@ -245,7 +245,15 @@ def find_duplicates(fs, compare_paths=None, quick=False, signature_chunk_size=16
if
__name__
==
"__main__"
:
from
fs.osfs
import
*
fs
=
OSFS
(
'~/duptest'
)
for
files
in
find_duplicates
(
fs
,
quick
=
False
):
print
files
from
osfs
import
*
fs
=
OSFS
(
'~/copytest'
)
from
memoryfs
import
*
m
=
MemoryFS
()
m
.
makedir
(
'maps'
)
copydir
((
fs
,
'maps'
),
(
m
,
'maps'
))
from
browsewin
import
browse
browse
(
m
)
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