diff --git a/fuse/ipns/ipns_test.go b/fuse/ipns/ipns_test.go index 25b3bf9f5..6b723e712 100644 --- a/fuse/ipns/ipns_test.go +++ b/fuse/ipns/ipns_test.go @@ -300,10 +300,12 @@ func TestFastRepublish(t *testing.T) { // Test writing a medium sized file one byte at a time func TestMultiWrite(t *testing.T) { - if runtime.GOOS == "darwin" { - link := "https://github.com/jbenet/go-ipfs/issues/147" - t.Skipf("Skipping as is broken in OSX. See %s", link) - } + /* + if runtime.GOOS == "darwin" { + link := "https://github.com/jbenet/go-ipfs/issues/147" + t.Skipf("Skipping as is broken in OSX. See %s", link) + } + */ _, mnt := setupIpnsTest(t, nil) defer mnt.Close() diff --git a/fuse/ipns/ipns_unix.go b/fuse/ipns/ipns_unix.go index f056b9974..5a795133d 100644 --- a/fuse/ipns/ipns_unix.go +++ b/fuse/ipns/ipns_unix.go @@ -232,6 +232,9 @@ func (s *Node) Attr() fuse.Attr { log.Errorf("Error getting size of file: %s", err) size = 0 } + if size == 0 { + size = s.dagMod.Size() + } return fuse.Attr{ Mode: 0666, Size: size, diff --git a/unixfs/io/dagmodifier.go b/unixfs/io/dagmodifier.go index a05b9d6ed..4683a157e 100644 --- a/unixfs/io/dagmodifier.go +++ b/unixfs/io/dagmodifier.go @@ -173,6 +173,13 @@ func (dm *DagModifier) WriteAt(b []byte, offset uint64) (int, error) { return origlen, nil } +func (dm *DagModifier) Size() uint64 { + if dm == nil { + return 0 + } + return dm.pbdata.GetFilesize() +} + // splitBytes uses a splitterFunc to turn a large array of bytes // into many smaller arrays of bytes func splitBytes(b []byte, spl chunk.BlockSplitter) [][]byte {