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

feat: support UnixFSv1.5 metadata #2621

Merged
merged 18 commits into from
Jan 10, 2020
Merged

feat: support UnixFSv1.5 metadata #2621

merged 18 commits into from
Jan 10, 2020

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Nov 21, 2019

Adds UnixFSv1.5 metadata support.

Specifying metadata:

$ jsipfs add --mode=0777 --mtime=100000 ./foo.txt

Respecting exsting metadata:

$ jsipfs add --preserve-mode --preserve-mtime ./foo.txt

Displaying metadata:

$ jsipfs ls Qmfoo
-rw-r--r-- Nov 21, 2019, 09:46:23 AM CST bar.txt Qbar 0

MFS gets chmod and touch commands:

$ jsipfs files mkdir /foo
$ jsipfs files ls -l
drwxr-xr-x	-	foo	QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn	0
$ jsipfs files touch /foo
$ jsipfs files ls -l
drwxr-xr-x	Nov 27, 2019, 03:00:01 PM GMT	foo	QmVUPK8PbWDKw9v2PUMmJcCc5NhWXVwBawpi8E4Q4MHiCp	0
$ jsipfs files chmod 0777 /foo
$ jsipfs files ls -l
drwxrwxrwx	Nov 27, 2019, 03:00:01 PM GMT	foo	QmTa5rbJMxooh4euvwFt6UQAXQYi2AUg3sCmmd9AEpmipw	0

RPC Changes:

  1. /api/v0/files/chmod and /api/v0/files/touch operations added
  2. mtime and mode arguments added to /api/v0/files/write and /api/v0/add

Depends on:

@alanshaw alanshaw requested review from Stebalien and removed request for Stebalien November 21, 2019 19:26
@alanshaw
Copy link
Member

sorry didn’t notice this was still in draft!

@achingbrain
Copy link
Member Author

Yeah - just wanted to get this all somewhere that a) wasn't on my laptop and b) where we can talk about the API while the implementation settles (e.g. I write tests)

src/cli/commands/add.js Outdated Show resolved Hide resolved
src/core/components/files-mfs.js Outdated Show resolved Hide resolved
@alanshaw alanshaw added exp/expert Having worked on the specific codebase is important P0 Critical: Tackled by core team ASAP labels Dec 16, 2019
Adds metadata support.

Specifying metadata:

```console
$ jsipfs add --mode=0777 --mtime=100000 ./foo.txt
```

Respecting exsting metadata:

```console
$ jsipfs add --preserve-mode --preserve-mtime ./foo.txt
```

Displaying metadata:

```console
$ jsipfs ls Qmfoo
-rw-r--r-- Nov 21, 2019, 09:46:23 AM CST bar.txt Qbar 0
```
@achingbrain achingbrain marked this pull request as ready for review January 9, 2020 11:09
@achingbrain
Copy link
Member Author

The pubsub tests will be the death of me.

@@ -36,6 +36,7 @@ const parser = yargs
.commandDir('commands')
.middleware(argv => Object.assign(argv, {
getIpfs: utils.singleton(cb => utils.getIPFS(argv, cb)),
getStdin: () => process.stdin,
Copy link
Member

Choose a reason for hiding this comment

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

👌

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/expert Having worked on the specific codebase is important P0 Critical: Tackled by core team ASAP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants