Support for read-only files - #13
Conversation
|
|
||
| self._closed = 0 | ||
| self._in_memory = 0 | ||
| self._oflags = os.O_RDWR |
There was a problem hiding this comment.
Can we either rename it to self._O_FLAGS or add a note about what _oflags is? It took me a few minutes to figure it out!
There was a problem hiding this comment.
I am slightly wary of naming non-consts with uppercase.
I'll add an explanation above the definition?
Basically this needs to be initially set to os.O_RDWR before the if filename is NoConstruct: block is called, since otherwise, when copying a read only template, it would preserve the permissions ("r") and would not allow to create / write to the copy.
Then, after mode is checked, I do self._oflags = _construct_mode(mode).
Let me know if this approach seems okay to you.
There was a problem hiding this comment.
Well it was a nitpick since I didn't find anything else wrong with the changes here!
Don't bother with changing it just for the sake of it. Only need to figure out the merge conflict and let's get this and #14 out in v0.5.0.
|
I've rebased with upstream/master. Not sure which way is preferred by yourself, but I usually do rebase to update my branch in fork. |
Code reused and improved upon from:
read_onlyproperty to BloomFilter to indicate whether the created bloom filter is read-only.@prashnts