Skip to content

Commit

Permalink
just use fd
Browse files Browse the repository at this point in the history
  • Loading branch information
Frens Jan Rumph committed Apr 18, 2017
1 parent 7aae7dc commit 4b6f2ba
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions bndl/compute/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,7 @@ def __init__(self, file_id, allocate=0):
fd = os.open(self.filepath, os.O_CREAT | os.O_WRONLY, mode=0o700)
try:
if allocate:
with open(fd, 'wb') as f:
os.posix_fallocate(f.fileno(), 0, allocate)
os.posix_fallocate(fd, 0, allocate)
finally:
os.close(fd)

Expand Down

0 comments on commit 4b6f2ba

Please sign in to comment.