Commit 5478c3c4 authored by Matt Bell's avatar Matt Bell

unixfs/tar: Use current date for file timestamps

parent c9ea7960
...@@ -7,6 +7,7 @@ import ( ...@@ -7,6 +7,7 @@ import (
"io" "io"
p "path" p "path"
"strings" "strings"
"time"
mdag "github.com/jbenet/go-ipfs/merkledag" mdag "github.com/jbenet/go-ipfs/merkledag"
path "github.com/jbenet/go-ipfs/path" path "github.com/jbenet/go-ipfs/path"
...@@ -79,6 +80,7 @@ func (i *Reader) writeToBuf(dagnode *mdag.Node, path string, depth int) { ...@@ -79,6 +80,7 @@ func (i *Reader) writeToBuf(dagnode *mdag.Node, path string, depth int) {
Name: path, Name: path,
Typeflag: tar.TypeDir, Typeflag: tar.TypeDir,
Mode: 0777, Mode: 0777,
ModTime: time.Now(),
// TODO: set mode, dates, etc. when added to unixFS // TODO: set mode, dates, etc. when added to unixFS
}) })
if err != nil { if err != nil {
...@@ -103,6 +105,7 @@ func (i *Reader) writeToBuf(dagnode *mdag.Node, path string, depth int) { ...@@ -103,6 +105,7 @@ func (i *Reader) writeToBuf(dagnode *mdag.Node, path string, depth int) {
Size: int64(pb.GetFilesize()), Size: int64(pb.GetFilesize()),
Typeflag: tar.TypeReg, Typeflag: tar.TypeReg,
Mode: 0644, Mode: 0644,
ModTime: time.Now(),
// TODO: set mode, dates, etc. when added to unixFS // TODO: set mode, dates, etc. when added to unixFS
}) })
if err != nil { if err != nil {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment