Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set file mode to 0444 instead of 0666 #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dolmen
Copy link
Contributor

@dolmen dolmen commented Apr 2, 2024

Set file mode to 0444(r--r--r--) as txtar is a read-only fileformat, and in general the io/fs.FS API doesn't allow to modify files.

@josharian
Copy link
Owner

This is fine I guess, but are there any circumstances in which it actually matters?

Set file mode to 0444 as txtar is a read-only fileformat, and in general
the io/fs.FS API doesn't allow to modify files.
@dolmen dolmen force-pushed the change-perms-to-readonly branch from 256742e to 009d3e7 Compare April 7, 2024 22:46
@dolmen
Copy link
Contributor Author

dolmen commented Apr 7, 2024

I've cleaned the patch to submit #2 and #3 separately.

@dolmen
Copy link
Contributor Author

dolmen commented Apr 7, 2024

are there any circumstances in which it actually matters?

A client of the io/fs.FS API might use different strategies for caching file data based on the FileMode: a file marked readonly might be considered as never changing, so not needing a reload after the first read.

Does it applies in cases where txtar specifically might be used? Probably not. But I still think this is the right way to set FileMode as io/fs.FS is a readonly API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants