1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-09 19:32:24 +08:00
Files
kubo/fuse/ipns/link_unix.go
Jeromy 0e312f5caf initial vendoring of libp2p outside of the repo with gx
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2016-01-30 09:34:06 -08:00

29 lines
620 B
Go

// +build !nofuse
package ipns
import (
"os"
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/bazil.org/fuse"
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/bazil.org/fuse/fs"
"gx/ipfs/QmZy2y8t9zQH2a1b8q2ZSLKp17ATuJoCNxxyMFG5qFExpt/go-net/context"
)
type Link struct {
Target string
}
func (l *Link) Attr(ctx context.Context, a *fuse.Attr) error {
log.Debug("Link attr.")
a.Mode = os.ModeSymlink | 0555
return nil
}
func (l *Link) Readlink(ctx context.Context, req *fuse.ReadlinkRequest) (string, error) {
log.Debugf("ReadLink: %s", l.Target)
return l.Target, nil
}
var _ fs.NodeReadlinker = (*Link)(nil)