Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

feat: metadata for ipfs.get #2759

Closed
wants to merge 2 commits into from
Closed

feat: metadata for ipfs.get #2759

wants to merge 2 commits into from

Conversation

alanshaw
Copy link
Member

@alanshaw alanshaw commented Feb 7, 2020

Comment on lines 22 to 26
const toBuffer = async function * (source) {
for await (const chunk of source) {
yield chunk.slice()
}
}
Copy link
Member

Choose a reason for hiding this comment

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

this pattern is begging for a it-transform

Copy link
Member Author

Choose a reason for hiding this comment

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

Could use this: https://www.npmjs.com/package/it-buffer, it's already used in libp2p.

Pack file `mtime` and `mode` if set

Depends on:

* [ ] #2758
* [ ] ipfs-inactive/js-ipfs-http-client#1235
@alanshaw
Copy link
Member Author

alanshaw commented Feb 9, 2020

I guess the CLI should set the mode when writing the file...and then...change it's mtime when done?

@@ -95,7 +95,9 @@ exports.get = {
async function * (source) {
for await (const file of source) {
const header = {
name: file.path
name: file.path,
mtime: file.mtime ? new Date(file.mtime.secs * 1000) : null,
Copy link
Member

Choose a reason for hiding this comment

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

Similar to my comment on ipfs-inactive/js-ipfs-http-client#1235 - can this support the nsecs mtime component too?

Copy link
Member

Choose a reason for hiding this comment

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

I think this might be more complicated than I'd previously thought - it-tar emits regular tar files, right? As I understand it, regular tar files only support seconds for mtimes, higher resolution requires GNU Tar files so it-tar may need to be updated to support producing these.

Copy link
Member Author

Choose a reason for hiding this comment

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

@achingbrain
Copy link
Member

Fixed by #3785

@achingbrain achingbrain deleted the feat/meta-for-get branch August 26, 2021 17:13
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants