Skip to content

Commit

Permalink
[timestmap flag] Fix bug when file is ReadOnly
Browse files Browse the repository at this point in the history
  • Loading branch information
hkchekc committed Apr 11, 2019
1 parent f0c97eb commit 9c81fa7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nixio/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ def __init__(self, path, mode=FileMode.ReadWrite,
if "updated_at" not in self._h5file.attrs:
self.force_updated_at()
self.time_auto_update = auto_update_time
if "time_auto_update" not in self._h5file.attrs:
if "time_auto_update" not in self._h5file.attrs \
and mode != FileMode.ReadOnly:
self._h5file.attrs["time_auto_update"] = auto_update_time
if compression == Compression.Auto:
compression = Compression.No
Expand Down

0 comments on commit 9c81fa7

Please sign in to comment.