MCPcopy
hub / github.com/rclone/rclone / NewObject

Method NewObject

backend/hdfs/fs.go:171–186  ·  view source on GitHub ↗

NewObject finds file at remote or return fs.ErrorObjectNotFound

(ctx context.Context, remote string)

Source from the content-addressed store, hash-verified

169
170// NewObject finds file at remote or return fs.ErrorObjectNotFound
171func (f *Fs) NewObject(ctx context.Context, remote string) (fs.Object, error) {
172 realpath := f.realpath(remote)
173 fs.Debugf(f, "new [%s]", realpath)
174
175 info, err := f.ensureFile(realpath)
176 if err != nil {
177 return nil, err
178 }
179
180 return &Object{
181 fs: f,
182 remote: remote,
183 size: info.Size(),
184 modTime: info.ModTime(),
185 }, nil
186}
187
188// List the objects and directories in dir into entries.
189func (f *Fs) List(ctx context.Context, dir string) (entries fs.DirEntries, err error) {

Callers

nothing calls this directly

Calls 5

realpathMethod · 0.95
ensureFileMethod · 0.95
DebugfFunction · 0.92
SizeMethod · 0.65
ModTimeMethod · 0.65

Tested by

no test coverage detected