MCPcopy
hub / github.com/cortexlabs/cortex / Open

Function Open

pkg/lib/files/files.go:50–62  ·  view source on GitHub ↗

the returned file should be closed by the caller

(path string)

Source from the content-addressed store, hash-verified

48
49// the returned file should be closed by the caller
50func Open(path string) (*os.File, error) {
51 cleanPath, err := EscapeTilde(path)
52 if err != nil {
53 return nil, err
54 }
55
56 file, err := os.Open(cleanPath)
57 if err != nil {
58 return nil, errors.Wrap(err, errors.Message(ErrorReadFile(path)))
59 }
60
61 return file, nil
62}
63
64// the returned file should be closed by the caller
65func OpenFile(path string, flag int, perm os.FileMode) (*os.File, error) {

Callers 8

UploadFileToS3Method · 0.92
UntarFileToDirFunction · 0.92
UntarFileToMemFunction · 0.92
UntgzFileToDirFunction · 0.92
UntgzFileToMemFunction · 0.92
HTTPUploadFunction · 0.92
CopyFileOverwriteFunction · 0.85
HashFileFunction · 0.85

Calls 4

WrapFunction · 0.92
MessageFunction · 0.92
EscapeTildeFunction · 0.85
ErrorReadFileFunction · 0.85

Tested by

no test coverage detected