You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: store time as timespec
To allow high resolution `mtime`, store time as `TimeSpec` message
which contains seconds and nanosecond fragments.
Also allows passing `mtime` and `mode` in multiple formats, fixes
coverage npm script and increases module test coverage.
* fix: enforce nsec value range
Allow 0-999.. but only marshal 1-999..
* fix: updates to latest spec with optional mtime
* docs: document mtime behaviour
Copy file name to clipboardExpand all lines: README.md
+22-2Lines changed: 22 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,7 @@ The UnixFS spec can be found inside the [ipfs/specs repository](http://github.co
36
36
-[get total fileSize](#get-total-filesize)
37
37
-[marshal and unmarshal](#marshal-and-unmarshal)
38
38
-[is this UnixFS entry a directory?](#is-this-unixfs-entry-a-directory)
39
+
-[has an mtime been set?](#has-an-mtime-been-set)
39
40
-[Contribute](#contribute)
40
41
-[License](#license)
41
42
@@ -116,7 +117,12 @@ message Data {
116
117
optional uint64 hashType = 5;
117
118
optional uint64 fanout = 6;
118
119
optional uint32 mode = 7;
119
-
optional int64 mtime = 8;
120
+
optional UnixTime mtime = 8;
121
+
}
122
+
123
+
message UnixTime {
124
+
required int64 Seconds = 1;
125
+
optional fixed32 FractionalNanoseconds = 2;
120
126
}
121
127
122
128
message Metadata {
@@ -142,7 +148,7 @@ const data = new UnixFS([options])
142
148
- data (Buffer): The optional data field for this node
143
149
- blockSizes (Array, default: `[]`): If this is a `file` node that is made up of multiple blocks, `blockSizes` is a list numbers that represent the size of the file chunks stored in each child node. It is used to calculate the total file size.
144
150
- mode (Number, default `0644` for files, `0755` for directories/hamt-sharded-directories) file mode
145
-
- mtime (Date, default `0`): The modification time of this node
151
+
- mtime (Date, { secs, nsecs }, { Seconds, FractionalNanoseconds }, [ secs, nsecs ], default { secs: 0 }): The modification time of this node
146
152
147
153
#### add and remove a block size to the block size list
0 commit comments