MCPcopy Create free account
hub / github.com/UiPath/uipathcli / Size

Method Size

utils/stream/file_stream.go:24–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22}
23
24func (s FileStream) Size() (int64, error) {
25 fileStat, err := os.Stat(s.path)
26 if err != nil && errors.Is(err, os.ErrNotExist) {
27 return -1, fmt.Errorf("File '%s' not found", s.path)
28 }
29 if err != nil {
30 return -1, fmt.Errorf("Error reading file size '%s': %w", s.path, err)
31 }
32 return fileStat.Size(), nil
33}
34
35func (s FileStream) Data() (io.ReadCloser, error) {
36 file, err := os.Open(s.path)

Callers 1

TestFileStreamSizeFunction · 0.95

Calls 1

SizeMethod · 0.65

Tested by 1

TestFileStreamSizeFunction · 0.76