1// Copyright 2018 Keybase Inc. All rights reserved. 2// Use of this source code is governed by a BSD 3// license that can be found in the LICENSE file. 4 5package libdokan 6 7import ( 8 "time" 9 10 "github.com/keybase/client/go/kbfs/libfs" 11 "github.com/keybase/client/go/kbfs/libkbfs" 12 "golang.org/x/net/context" 13) 14 15// NewFileInfoFile returns a special file that contains a text 16// representation of a file's KBFS metadata. 17func NewFileInfoFile( 18 fs *FS, dir libkbfs.Node, name string) *SpecialReadFile { 19 return &SpecialReadFile{ 20 read: func(ctx context.Context) ([]byte, time.Time, error) { 21 return libfs.GetFileInfo(ctx, fs.config, dir, name) 22 }, 23 fs: fs, 24 } 25} 26