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
18201481
Commit
18201481
authored
Jan 08, 2011
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(hopefully) fix handling of remote UNC paths in OSFS
parent
36b841d6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
ChangeLog
+6
-2
fs/osfs/__init__.py
+8
-4
No files found.
ChangeLog
View file @
18201481
...
...
@@ -44,9 +44,12 @@
for wildcards.
* Added listdirinfo method, which yields both the entry names and the
corresponding info dicts in a single operation.
* Fixed operation of OSFS on win32 when it points to the root of a drive.
* Made SubFS a subclass of WrapFS, and moved it into its own module at
fs.wrapfs.subfs.
* Path-handling fixes for OSFS on win32:
* Work properly when pointing to the root of a drive.
* Better handling of remote UNC paths.
* Add ability to switch off use of long UNC paths.
* OSFSWatchMixin improvements:
* watch_inotify: allow more than one watcher on a single path.
* watch_win32: don't create immortal reference cycles.
...
...
@@ -65,7 +68,8 @@
* Added a getmmap to base
* Added command line scripts fsls, fstree, fscat, fscp, fsmv
* Added command line scripts fsmkdir, fsmount
* Made SFTP automatically pick up keys if no other authentication is available
* Made SFTP automatically pick up keys if no other authentication
is available
* Optimized listdir and listdirinfo in SFTPFS
* Made memoryfs work with threads
* Added copyfile_non_atomic and movefile_non_atomic for improved performance of multi-threaded copies
...
...
fs/osfs/__init__.py
View file @
18201481
...
...
@@ -84,7 +84,7 @@ class OSFS(OSFSXAttrMixin, OSFSWatchMixin, FS):
'atomic.setcontents'
:
False
,
}
def
__init__
(
self
,
root_path
,
thread_synchronize
=
_thread_synchronize_default
,
encoding
=
None
,
create
=
False
,
dir_mode
=
0700
):
def
__init__
(
self
,
root_path
,
thread_synchronize
=
_thread_synchronize_default
,
encoding
=
None
,
create
=
False
,
dir_mode
=
0700
,
use_long_paths
=
True
):
"""
Creates an FS object that represents the OS Filesystem under a given root path
...
...
@@ -99,14 +99,18 @@ class OSFS(OSFSXAttrMixin, OSFSWatchMixin, FS):
super
(
OSFS
,
self
)
.
__init__
(
thread_synchronize
=
thread_synchronize
)
self
.
encoding
=
encoding
or
sys
.
getfilesystemencoding
()
self
.
dir_mode
=
dir_mode
self
.
use_long_paths
=
use_long_paths
root_path
=
os
.
path
.
expanduser
(
os
.
path
.
expandvars
(
root_path
))
root_path
=
os
.
path
.
normpath
(
os
.
path
.
abspath
(
root_path
))
# Enable long pathnames on win32
if
sys
.
platform
==
"win32"
:
if
not
root_path
.
startswith
(
"
\\\\
?
\\
"
):
root_path
=
u"
\\\\
?
\\
"
+
root_path
if
use_long_paths
and
not
root_path
.
startswith
(
"
\\\\
?
\\
"
):
if
not
root_path
.
startswith
(
"
\\
"
):
root_path
=
u"
\\\\
?
\\
"
+
root_path
else
:
root_path
=
u"
\\\\
?"
+
root_path
# If it points at the root of a drive, it needs a trailing slash.
if
len
(
root_path
)
==
6
:
if
len
(
root_path
)
==
6
and
not
root_path
.
endswith
(
"
\\
"
)
:
root_path
=
root_path
+
"
\\
"
if
create
:
...
...
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