aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 ) )