aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--meta/info.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/info.go b/meta/info.go
index 81aac3a..57aa937 100644
--- a/meta/info.go
+++ b/meta/info.go
@@ -59,7 +59,7 @@ func (i Info) GetPieces() []Piece {
return p
}
-// Open file and allocate required path
+// Open N-th file and allocate required path
func (i Info) Open(n int) (*os.File, error) {
var p string
if len(i.Files) == 0 {
@@ -73,6 +73,7 @@ func (i Info) Open(n int) (*os.File, error) {
return os.OpenFile(i.Name, os.O_RDWR|os.O_CREATE, 0644)
}
+// Offset of piece in gross buffer
func (i Info) Offset(piece int) int {
return i.PieceLength * piece
}