-
Notifications
You must be signed in to change notification settings - Fork 95
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
feat: support UnixFS 1.5 file mode and modification times #34
Conversation
Thank you for submitting this PR!
Getting other community members to do a review would be great help too on complex PRs (you can ask in the chats/forums). If you are unsure about something, just leave us a comment.
We currently aim to provide initial feedback/triaging within two business days. Please keep an eye on any labelling actions, as these will indicate priorities and status of your contribution. |
Codecov Report
@@ Coverage Diff @@
## main #34 +/- ##
==========================================
+ Coverage 63.75% 65.94% +2.19%
==========================================
Files 32 30 -2
Lines 1694 1856 +162
==========================================
+ Hits 1080 1224 +144
- Misses 477 486 +9
- Partials 137 146 +9
|
Currently the Golang runtime doesn't support changing the time on a symbolic link.
This commit was moved from ipfs/go-ipfs-routing@bf0374f
Any status on where this is? It seems to be stalled. |
@zacharywhitley, unfortunately I don't think there's any real interest in this feature; This has been awaiting review for some time, and the completed ipfs/kubo#6920 PRs prior to the refactoring met the same fate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something we should add in this PR is to update boxo/gateway
as well, and expose mtime
as Last-Modified
on HTTP Gateway responses (if present)
t.Fatalf("Expected file modified time to be [%v] but got [%v]", mtime, rf.ModTime()) | ||
} | ||
} | ||
|
||
func TestMultipartFiles(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💭 are these required, and we need to effectively break the wire format? Could we avoid it and be backward compatible?
If so, we want to keep original tests without mode
and mtime
being sent over the wire.
Perhaps refactor into separate TestMultipartFiles
and TestMultipartFilesWithMtime
?
Replaces PR #34 written by @kstuart Adds support for storing and retrieving file mode and last modification time. Support added to: - [X] Files - [X] LinkFiles - [X] Webfiles - [X] Directories - [X] Tar Archives When the TAR archive (headers) include a file mode or modification time, the extractor will restore that metadata when supported for the underlying filesystem. The Golang runtime currently does not support changing the times on a symlink, for Linux and some BSDs a custom solution has been implemented, for Darwin this is not the case so when copying a symlink to the filesystem the last modification time is not updated. Since for concrete files and directories stored modes and modification times are faithfully restored to the filesystem this should not be a breaking issue, a similar solution to that implemented for Linux/BSDs is likely implementable by a developer with access to a Darwin platform. Replaces PRs: - ipfs/go-ipfs-files#31 - ipfs/tar-utils#11 - #34 Relates to ipfs/kubo#6920
Replaced by PR #653 |
Adds support for storing and retrieving file mode and last modification time.
Support added to:
When the TAR archive (headers) include a file mode or modification time, the extractor will restore that metadata when supported for the underlying filesystem.
The Golang runtime currently does not support changing the times on a symlink, for Linux and some BSDs a custom solution has been implemented, for Darwin this is not the case so when copying a symlink to the filesystem the last modification time is not updated. Since for concrete files and directories stored modes and modification times are faithfully restored to the filesystem this should not be a breaking issue, a similar solution to that implemented for Linux/BSDs is likely implementable by a developer with access to a Darwin platform.
Replaces PRs:
Relates to ipfs/kubo#6920