MCPcopy
hub / github.com/wavetermdev/waveterm / Stat

Method Stat

pkg/filestore/blockstore.go:177–188  ·  view source on GitHub ↗

if file doesn't exsit, returns fs.ErrNotExist

(ctx context.Context, zoneId string, name string)

Source from the content-addressed store, hash-verified

175
176// if file doesn't exsit, returns fs.ErrNotExist
177func (s *FileStore) Stat(ctx context.Context, zoneId string, name string) (*WaveFile, error) {
178 return withLockRtn(s, zoneId, name, func(entry *CacheEntry) (*WaveFile, error) {
179 file, err := entry.loadFileForRead(ctx)
180 if err != nil {
181 if err == fs.ErrNotExist {
182 return nil, err
183 }
184 return nil, fmt.Errorf("error getting file: %v", err)
185 }
186 return file.DeepCopy(), nil
187 })
188}
189
190func (s *FileStore) ListFiles(ctx context.Context, zoneId string) ([]*WaveFile, error) {
191 files, err := dbGetZoneFiles(ctx, zoneId)

Callers 15

DebugTermCommandMethod · 0.80
prepareDestForCopyFunction · 0.80
remoteCopyFileInternalFunction · 0.80
fileInfoInternalMethod · 0.80
RemoteFileMoveCommandMethod · 0.80
RemoteMkdirCommandMethod · 0.80
ResolveGoFmtPathFunction · 0.80

Calls 3

withLockRtnFunction · 0.85
loadFileForReadMethod · 0.80
DeepCopyMethod · 0.80

Tested by 6

TestAtomicWriteFileFunction · 0.64
TestCreateFunction · 0.64
TestDeleteFunction · 0.64
TestSetMetaFunction · 0.64
checkFileSizeFunction · 0.64