github.com/keybase/client/go@v0.0.0-20241007131713-f10651d043c8/kbfs/libdokan/file_info_file.go (about)

     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  
     5  package libdokan
     6  
     7  import (
     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.
    17  func 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  }