https://github.com/ipfs/go-ipfs
Raw File
Tip revision: 8431e2e870def1632fe82e368fc9d40d72192f9b authored by Steven Allen on 09 May 2020, 02:58:18 UTC
Merge pull request #7295 from ipfs/release-v0.5.1
Tip revision: 8431e2e
link_unix.go
// +build !nofuse,!openbsd,!netbsd

package ipns

import (
	"context"
	"os"

	"bazil.org/fuse"
	"bazil.org/fuse/fs"
)

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)
back to top