mirror of
https://github.com/kopia/kopia.git
synced 2026-10-25 23:58:54 -04:00
added support for symlink reads to repofs
This commit is contained in:
1 parent
175c05d547
commit
5959aa354e
1 file changed
+13
-1
+13
-1
@@ -3,6 +3,7 @@ package repofs
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/kopia/kopia/fs"
|
||||
"github.com/kopia/kopia/repo"
|
||||
@@ -74,7 +75,18 @@ func (rf *repositoryFile) Open() (fs.Reader, error) {
|
||||
}
|
||||
|
||||
func (rsl *repositorySymlink) Readlink() (string, error) {
|
||||
panic("not implemented yet")
|
||||
r, err := rsl.repo.Open(rsl.metadata.ObjectID)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
defer r.Close()
|
||||
b, err := ioutil.ReadAll(r)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return string(b), nil
|
||||
}
|
||||
|
||||
func newRepoEntry(r *repo.Repository, md *dirEntry, parent fs.Directory) fs.Entry {
|
||||
|
||||
Reference in new issue
Block a user