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

Keep track of file permissions #32

Closed
wants to merge 1 commit into from
Closed

Keep track of file permissions #32

wants to merge 1 commit into from

Conversation

fredrikekre
Copy link
Member

With this patch the file mode of files in relocatable folders are recorded when the file is originally read. When the underlying folder is removed and the contents are written to scratch space, the original file mode is set on the new files.

Opening as a draft because: i) I don't know (yet) how this interacts with packages that are Pkg.added (the package manager makes all files read only) and ii) don't know what happens on Windows.

With this patch the file mode of files in relocatable folders are
recorded when the file is originally read. When the underlying folder is
removed and the contents are written to scratch space, the original file
mode is set on the new files.
Copy link
Member

@staticfloat staticfloat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A part of me wonders if we shouldn't rearchitect this package to use Tar.jl to import the files to be relocated, then use Tar.extract() to write it out. Our Tar package is kind of the defacto "data serialization format" that we use in Pkg, and so it handles all the permissions and directory traversal and whatnot issues that we will inevitably run into in this package. I'll open an issue about that so we can discuss it not in this PR.

@@ -0,0 +1 @@
This file is readonly.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Git doesn't track readonly permissions; it only tracks executable or not; you'll need to create a readonly file (or modify this one via chmod()) in order to properly test.

@fredrikekre
Copy link
Member Author

I don't think this is a good approach since file permissions can't really be relied upon (e.g. Pkg changes to read-only when installing etc).

@fredrikekre fredrikekre deleted the fe/filemodes branch December 18, 2023 14:57
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