1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-26 15:42:21 +08:00

probably fix OSX ipns bug

This commit is contained in:
Jeromy
2014-11-07 11:35:50 -08:00
committed by Juan Batiz-Benet
parent 3155fa2c6f
commit 2e2d02a741
3 changed files with 16 additions and 4 deletions

View File

@ -300,10 +300,12 @@ func TestFastRepublish(t *testing.T) {
// Test writing a medium sized file one byte at a time // Test writing a medium sized file one byte at a time
func TestMultiWrite(t *testing.T) { func TestMultiWrite(t *testing.T) {
if runtime.GOOS == "darwin" { /*
link := "https://github.com/jbenet/go-ipfs/issues/147" if runtime.GOOS == "darwin" {
t.Skipf("Skipping as is broken in OSX. See %s", link) link := "https://github.com/jbenet/go-ipfs/issues/147"
} t.Skipf("Skipping as is broken in OSX. See %s", link)
}
*/
_, mnt := setupIpnsTest(t, nil) _, mnt := setupIpnsTest(t, nil)
defer mnt.Close() defer mnt.Close()

View File

@ -232,6 +232,9 @@ func (s *Node) Attr() fuse.Attr {
log.Errorf("Error getting size of file: %s", err) log.Errorf("Error getting size of file: %s", err)
size = 0 size = 0
} }
if size == 0 {
size = s.dagMod.Size()
}
return fuse.Attr{ return fuse.Attr{
Mode: 0666, Mode: 0666,
Size: size, Size: size,

View File

@ -173,6 +173,13 @@ func (dm *DagModifier) WriteAt(b []byte, offset uint64) (int, error) {
return origlen, nil 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 // splitBytes uses a splitterFunc to turn a large array of bytes
// into many smaller arrays of bytes // into many smaller arrays of bytes
func splitBytes(b []byte, spl chunk.BlockSplitter) [][]byte { func splitBytes(b []byte, spl chunk.BlockSplitter) [][]byte {