MCPcopy
hub / github.com/rclone/rclone / _size

Method _size

vfs/read_write.go:223–236  ·  view source on GitHub ↗

_size returns the size of the underlying file and also sets it in the owning file call with the lock held

()

Source from the content-addressed store, hash-verified

221//
222// call with the lock held
223func (fh *RWFileHandle) _size() int64 {
224 size, err := fh.item.GetSize()
225 if err != nil {
226 o := fh.file.getObject()
227 if o != nil {
228 size = o.Size()
229 } else {
230 fs.Errorf(fh.logPrefix(), "Couldn't read size of file")
231 size = 0
232 }
233 }
234 fh.file.setSize(size)
235 return size
236}
237
238// Size returns the size of the underlying file
239func (fh *RWFileHandle) Size() int64 {

Callers 7

openPendingMethod · 0.95
updateSizeMethod · 0.95
SizeMethod · 0.95
_readAtMethod · 0.95
SeekMethod · 0.95
_writeAtMethod · 0.95
_truncateMethod · 0.95

Calls 6

logPrefixMethod · 0.95
ErrorfFunction · 0.92
getObjectMethod · 0.80
setSizeMethod · 0.80
SizeMethod · 0.65
GetSizeMethod · 0.45

Tested by

no test coverage detected