Skip to content

Commit

Permalink
small change in allocate
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Dec 30, 2015
1 parent 2be4a28 commit c535257
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/netius/common/stream.py
Expand Up @@ -109,11 +109,12 @@ def open(self, mode = "w+b", allocate = True):
file_size = file_m["length"]
file_path = os.path.join(self.dir_path, *file_path)
file = open(file_path, mode)
file_t = (file, file_m)
self.files.append(file_t)
if not allocate: continue
file.seek(file_size - 1)
file.write(b"\0")
file.flush()
file_t = (file, file_m)
self.files.append(file_t)

def close(self):
if not self.files: return
Expand Down

0 comments on commit c535257

Please sign in to comment.