aboutsummaryrefslogtreecommitdiff
path: root/chunk.go
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2021-09-13 10:52:26 +0200
committern-peugnet <n.peugnet@free.fr>2021-09-13 10:53:48 +0200
commit4168e8c6ed41fa4cb53dfded67caed79a82e8789 (patch)
tree95b970fc2da9ff6cd32710e28c56a31494a6d749 /chunk.go
parent13e45db0878bc2dc36ad4578c0758dd05879cded (diff)
downloaddna-backup-4168e8c6ed41fa4cb53dfded67caed79a82e8789.tar.gz
dna-backup-4168e8c6ed41fa4cb53dfded67caed79a82e8789.zip
add read write wrappers to compress chunks' content
Diffstat (limited to 'chunk.go')
-rw-r--r--chunk.go9
1 files changed, 1 insertions, 8 deletions
diff --git a/chunk.go b/chunk.go
index a1cf3cd..14b8cfd 100644
--- a/chunk.go
+++ b/chunk.go
@@ -4,8 +4,6 @@ import (
"bytes"
"fmt"
"io"
- "log"
- "os"
"path"
)
@@ -87,12 +85,7 @@ func (c *StoredChunk) Reader() io.ReadSeeker {
}
func (c *StoredChunk) Len() int {
- path := c.Id.Path(c.repo.path)
- info, err := os.Stat(path)
- if err != nil {
- log.Println("Chunk: could not stat file:", path)
- }
- return int(info.Size())
+ return c.repo.chunkSize
}
func NewTempChunk(value []byte) *TempChunk {