boxo icon indicating copy to clipboard operation
boxo copied to clipboard

feat: support UnixFS 1.5 file mode and modification times

Open kstuart opened this issue 2 years ago • 4 comments

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:

  • https://github.com/ipfs/go-ipfs-files/pull/31
  • https://github.com/ipfs/tar-utils/pull/11

Relates to https://github.com/ipfs/kubo/issues/6920

kstuart avatar Jan 21 '23 19:01 kstuart

Thank you for submitting this PR! A maintainer will be here shortly to review it. We are super grateful, but we are also overloaded! Help us by making sure that:

  • The context for this PR is clear, with relevant discussion, decisions and stakeholders linked/mentioned.

  • Your contribution itself is clear (code comments, self-review for the rest) and in its best form. Follow the code contribution guidelines if they apply.

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. Next steps:

  • A maintainer will triage and assign priority to this PR, commenting on any missing things and potentially assigning a reviewer for high priority items.

  • The PR gets reviews, discussed and approvals as needed.

  • The PR is merged by maintainers when it has been approved and comments addressed.

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. We are very grateful for your contribution!

welcome[bot] avatar Jan 21 '23 19:01 welcome[bot]

Codecov Report

Merging #34 (7161a2f) into main (c444cbb) will increase coverage by 2.19%. The diff coverage is 78.01%.

:exclamation: Current head 7161a2f differs from pull request most recent head 77cdc80. Consider uploading reports for the commit 77cdc80 to get more accurate results

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
files/serialfile.go 63.72% <0.00%> (-2.61%) :arrow_down:
tar/extractor.go 51.04% <51.31%> (-0.36%) :arrow_down:
tar/util_posix.go 60.00% <60.00%> (ø)
files/multipartfile.go 83.51% <78.84%> (-2.41%) :arrow_down:
files/util.go 75.86% <89.47%> (+25.86%) :arrow_up:
files/tarwriter.go 83.52% <93.54%> (+10.91%) :arrow_up:
files/linkfile.go 64.00% <100.00%> (+24.00%) :arrow_up:
files/multifilereader.go 85.45% <100.00%> (+3.43%) :arrow_up:
files/readerfile.go 77.08% <100.00%> (+10.41%) :arrow_up:
files/slicedirectory.go 80.32% <100.00%> (+6.99%) :arrow_up:
... and 1 more

... and 3 files with indirect coverage changes

codecov[bot] avatar Jan 26 '23 06:01 codecov[bot]

Any status on where this is? It seems to be stalled.

zacharywhitley avatar Oct 29 '23 12:10 zacharywhitley

@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 https://github.com/ipfs/kubo/issues/6920 PRs prior to the refactoring met the same fate.

kstuart avatar Oct 30 '23 07:10 kstuart

Replaced by PR #653

gammazero avatar Aug 07 '24 02:08 gammazero