aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Slaven <bpk@hoopajoo.net>2009-07-28 20:11:59 (GMT)
committerSteve Slaven <bpk@hoopajoo.net>2009-07-28 20:11:59 (GMT)
commitfd90e3e2de2f74d8a7f6ea67109f9c1c543b7b69 (patch)
treef95dd69faeba71dc830cc0f3b0aa056f4be93c0a
parent5c38b23cd7b04b06a19a060397ab79335d4a3fb5 (diff)
downloadfusearchive-fd90e3e2de2f74d8a7f6ea67109f9c1c543b7b69.zip
fusearchive-fd90e3e2de2f74d8a7f6ea67109f9c1c543b7b69.tar.gz
fusearchive-fd90e3e2de2f74d8a7f6ea67109f9c1c543b7b69.tar.bz2
Only add O_CREAT if it was passed initially
-rwxr-xr-xfusearchive.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/fusearchive.py b/fusearchive.py
index aad8c0f..035c06b 100755
--- a/fusearchive.py
+++ b/fusearchive.py
@@ -504,7 +504,11 @@ class FuseArchive(Fuse):
# files works (in the create a read-only file for writing case)
src = "./tree" + path
logging.debug( "Saving fh for " + src )
- nflags = os.O_RDWR | os.O_APPEND | os.O_CREAT
+ nflags = os.O_RDWR | os.O_APPEND
+ if flags & os.O_CREAT:
+ logging.debug( "Adding O_CREAT" )
+ nflags = nflags | os.O_CREAT
+
self.file = os.fdopen( os.open( src, nflags, *mode ),
flag2mode( nflags ) )