# HG changeset patch # User ft # Date 1397032039 -7200 # Node ID 74a3519ac9b340c3b3be35e7cdf89178497c2b77 # Parent df3d231adebb25ebf97df23a94a52c2d2ad56027 Fixed windows append isse removed useless modes diff -r df3d231adebb -r 74a3519ac9b3 src/OsecFS.py --- a/src/OsecFS.py Tue Apr 08 15:45:34 2014 +0200 +++ b/src/OsecFS.py Wed Apr 09 10:27:19 2014 +0200 @@ -116,8 +116,10 @@ md = {os.O_RDONLY: 'r', os.O_WRONLY: 'w', os.O_RDWR: 'w+'} m = md[flags & (os.O_RDONLY | os.O_WRONLY | os.O_RDWR)] - if flags | os.O_APPEND: - m = m.replace('w', 'a', 1) + # windows sets append even if it would overwrite the whole file (seek 0) + # so ignore append option + #if flags | os.O_APPEND: + # m = m.replace('w', 'a', 1) return m @@ -330,7 +332,7 @@ if (config.get("Main", "ReadOnly") == "true"): sendReadOnlyNotification() return -errno.EACCES - f = open (fixPath (path), "rw+") + f = open (fixPath (path), "w+") f.truncate (length) f.close () @@ -367,7 +369,7 @@ return -errno.EACCES #self.file = os.fdopen (os.open (fixPath (path), flags, mode), flag2mode (flags)) # fix strange Windows behaviour - self.file = os.fdopen (os.open (fixPath (path), flags, mode), "rw+") + self.file = os.fdopen (os.open (fixPath (path), flags, mode), "w+") self.fd = self.file.fileno ()