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
930a94dd
Commit
930a94dd
authored
Sep 26, 2010
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs.expose.fuse: fix opening of files with mode "w+"
parent
4a459983
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
fs/base.py
+2
-2
fs/expose/fuse/__init__.py
+4
-1
No files found.
fs/base.py
View file @
930a94dd
...
@@ -890,8 +890,6 @@ class FS(object):
...
@@ -890,8 +890,6 @@ class FS(object):
def
flags_to_mode
(
flags
):
def
flags_to_mode
(
flags
):
"""Convert an os.O_* flag bitmask into an FS mode string."""
"""Convert an os.O_* flag bitmask into an FS mode string."""
if
flags
&
os
.
O_EXCL
:
raise
UnsupportedError
(
"open"
,
msg
=
"O_EXCL is not supported"
)
if
flags
&
os
.
O_WRONLY
:
if
flags
&
os
.
O_WRONLY
:
if
flags
&
os
.
O_TRUNC
:
if
flags
&
os
.
O_TRUNC
:
mode
=
"w"
mode
=
"w"
...
@@ -908,4 +906,6 @@ def flags_to_mode(flags):
...
@@ -908,4 +906,6 @@ def flags_to_mode(flags):
mode
=
"r+"
mode
=
"r+"
else
:
else
:
mode
=
"r"
mode
=
"r"
if
flags
&
os
.
O_EXCL
:
mode
+=
"x"
return
mode
return
mode
fs/expose/fuse/__init__.py
View file @
930a94dd
...
@@ -165,7 +165,10 @@ class FSOperations(Operations):
...
@@ -165,7 +165,10 @@ class FSOperations(Operations):
@handle_fs_errors
@handle_fs_errors
def
create
(
self
,
path
,
mode
,
fi
):
def
create
(
self
,
path
,
mode
,
fi
):
path
=
path
.
decode
(
NATIVE_ENCODING
)
path
=
path
.
decode
(
NATIVE_ENCODING
)
fh
=
self
.
_reg_file
(
self
.
fs
.
open
(
path
,
"w"
),
path
)
# FUSE doesn't seem to pass correct mode information here - at least,
# I haven't figured out how to distinguish between "w" and "w+".
# Go with the most permissive option.
fh
=
self
.
_reg_file
(
self
.
fs
.
open
(
path
,
"w+"
),
path
)
fi
.
fh
=
fh
fi
.
fh
=
fh
fi
.
keep_cache
=
0
fi
.
keep_cache
=
0
...
...
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