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

Support for opening OS files that are not writable #76

Open
aucampia opened this issue Jun 23, 2021 · 4 comments
Open

Support for opening OS files that are not writable #76

aucampia opened this issue Jun 23, 2021 · 4 comments

Comments

@aucampia
Copy link
Contributor

Currently OS files are always opened in read/write mode. In cases where files are not writable to the process this causes problems. It would be good to have some way to accomodate read only OS files.

@aucampia
Copy link
Contributor Author

aucampia commented Jun 23, 2021

One way this could be implemented is to add an Options varargs type to Open, and then make a read only option. Other suggestions would be appreciated.

@aucampia
Copy link
Contributor Author

This may be relevant to SFTP also

@seeroush
Copy link
Contributor

@aucampia - my first thought was to include this as an option as well. It might just need a bit of thought on how error handling works for some of the vfs.File interface methods when the option is enabled.

Perhaps an alternative is to make the getInternalFile() function take the file mode, and then let the consumers of that getInternalFile function (vfs.Read(), vfs.Write(), etc...) pass the required modes to perform that operation. A hybrid approach might work as well.

@siddharthab
Copy link

Would you appreciate a PR to help with any work here?

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

No branches or pull requests

4 participants