projects
/
tahoe-lafs
/
tahoe-lafs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d021736
)
zfec: fix another problem with the O_BINARY flag
author
Zooko O'Whielacronx
<zooko@zooko.com>
Sat, 21 Apr 2007 14:48:47 +0000
(07:48 -0700)
committer
Zooko O'Whielacronx
<zooko@zooko.com>
Sat, 21 Apr 2007 14:48:47 +0000
(07:48 -0700)
src/zfec/zfec/filefec.py
patch
|
blob
|
history
diff --git
a/src/zfec/zfec/filefec.py
b/src/zfec/zfec/filefec.py
index efacd12e801db72223c5df6b280355d989b481cd..55908504126b29810a7492aefff5b7a4978ce973 100644
(file)
--- a/
src/zfec/zfec/filefec.py
+++ b/
src/zfec/zfec/filefec.py
@@
-174,7
+174,8
@@
def encode_to_files(inf, fsize, dirname, prefix, k, m, suffix=".fec", overwrite=
if overwrite:
f = open(fn, "wb")
else:
- fd = os.open(fn, os.O_WRONLY|os.O_CREAT|os.O_EXCL|os.O_BINARY)
+ flags = os.O_WRONLY|os.O_CREAT|os.O_EXCL | (hasattr(os, 'O_BINARY') and os.O_BINARY)
+ fd = os.open(fn, flags)
f = os.fdopen(fd, "wb")
f.write(hdr)
fs.append(f)