github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/kbfs/libdokan/empty_folder.go (about) 1 // Copyright 2016 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 "github.com/keybase/client/go/kbfs/dokan" 9 "golang.org/x/net/context" 10 ) 11 12 // EmptyFolder represents an empty, read-only KBFS TLF that has not 13 // been created by someone with sufficient permissions. 14 type EmptyFolder struct { 15 emptyFile 16 } 17 18 func (ef *EmptyFolder) open(ctx context.Context, oc *openContext, path []string) (f dokan.File, cst dokan.CreateStatus, err error) { 19 if len(path) != 0 { 20 return nil, 0, dokan.ErrObjectNameNotFound 21 } 22 return oc.returnDirNoCleanup(ef) 23 } 24 25 // GetFileInformation for dokan. 26 func (*EmptyFolder) GetFileInformation(context.Context, *dokan.FileInfo) (a *dokan.Stat, err error) { 27 return defaultDirectoryInformation() 28 } 29 30 // FindFiles for dokan. 31 func (*EmptyFolder) FindFiles(ctx context.Context, fi *dokan.FileInfo, ignored string, callback func(*dokan.NamedStat) error) (err error) { 32 return nil 33 }