Skip to content

Commit

Permalink
set permissions on output to readable for all
Browse files Browse the repository at this point in the history
  • Loading branch information
garyjg committed Jan 6, 2025
1 parent 91e1215 commit 72e9218
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dump_hotfilm.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ def finish(self, minutes: int):
logger.info("file finished with %d mins, renaming: %s",
minutes, fpath)
fpath = Path(self.tfile.name).rename(fpath)
# the files should not need to be writable
fpath.chmod(0o444)
self.tfile = None
self.path = None
self.when = None
Expand Down
2 changes: 2 additions & 0 deletions test_dump_hotfilm.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ def test_netcdf_output():
logger.debug("dumping: %s", " ".join(args))
main(args)
assert xout.exists() and xout.stat().st_size > 0
# make sure we get permissions ugo=r also
assert xout.stat().st_mode & 0o444 == 0o444
# hardcode for now, but might need to be configurable. it should also be
# feasible to just open both files with xarray and compare the datasets.
nc_compare = Path("/opt/local/bin/nc_compare")
Expand Down

0 comments on commit 72e9218

Please sign in to comment.