Skip to content

Commit f5f6c7e

Browse files
Change downloaded file permission based on umask (#5800)
Change downloaded file permission respecting umask
1 parent 5b011a2 commit f5f6c7e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/datasets/utils/file_utils.py

+3
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,9 @@ def _resumable_file_manager():
621621

622622
logger.info(f"storing {url} in cache at {cache_path}")
623623
shutil.move(temp_file.name, cache_path)
624+
umask = os.umask(0o666)
625+
os.umask(umask)
626+
os.chmod(cache_path, 0o666 & ~umask)
624627

625628
logger.info(f"creating metadata file for {cache_path}")
626629
meta = {"url": url, "etag": etag}

0 commit comments

Comments
 (0)