-
Notifications
You must be signed in to change notification settings - Fork 14
Conversation
Adds UnixFSv1.5 metadata support to mfs, including displaying it when listing dirs and statting files. Also adds `touch` and `chmod` commands to manipulate metadata in a similar way to the unix shell.
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.
Also needs a PR to interface-ipfs-core
to document the new commands.
src/cli/cp.js
Outdated
@@ -18,7 +18,7 @@ module.exports = { | |||
describe: 'Create any non-existent intermediate directories' | |||
}, | |||
format: { | |||
alias: 'h', | |||
alias: 'f', |
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.
Technically a breaking change...
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.
Not sure - h
was taken by another command so the short version of this option never worked before. More of a fix?
src/cli/mkdir.js
Outdated
type: 'number', | ||
default: true, | ||
coerce: asOctal, | ||
describe: 'Mtime to apply to the new directory' |
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.
As discussed, peeps probably want to use strings.
src/cli/touch.js
Outdated
alias: 'm', | ||
type: 'number', | ||
default: parseInt(Date.now() / 1000), | ||
describe: 'Time to use as the new modification time' |
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.
describe: 'Time to use as the new modification time' | |
describe: 'Time in seconds since the Unix epoch to use as the new modification time' |
...or is it seconds?
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.
It's seconds in the spec.
src/core/write.js
Outdated
|
||
// persist mode & mtime if set previously | ||
mode: (destination.unixfs && destination.unixfs.mode) || options.mode, | ||
mtime: (destination.unixfs && destination.unixfs.mtime) ? parseInt(new Date() / 1000) : options.mtime |
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.
If the create
flag is set and the file doesn't exist, can we set mtime
and mode
please?
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.
UnixFS entries get a default mode but not an mtime. I'll change it so it'll honour them if you pass them in.
@@ -8,7 +8,7 @@ const multihash = require('multihashes') | |||
const createMfs = require('./helpers/create-mfs') | |||
const cidAtPath = require('./helpers/cid-at-path') | |||
const createShardedDirectory = require('./helpers/create-sharded-directory') | |||
const all = require('async-iterator-all') | |||
const all = require('it-all') |
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.
sooooo much nicer
Adds support for UnixsFSv1.5 metadata along with
touch
andchmod
commands to manipulate that metadata.Depends on: