MCPcopy Index your code
hub / github.com/rclone/rclone / Write

Method Write

vfs/write.go:164–169  ·  view source on GitHub ↗

Write writes len(p) bytes from p to the underlying data stream. It returns the number of bytes written from p (0 <= n <= len(p)) and any error encountered that caused the write to stop early. Write must return a non-nil error if it returns n < len(p). Write must not modify the slice data, even tempo

(p []byte)

Source from the content-addressed store, hash-verified

162//
163// Implementations must not retain p.
164func (fh *WriteFileHandle) Write(p []byte) (n int, err error) {
165 fh.mu.Lock()
166 defer fh.mu.Unlock()
167 // Since we can't seek, just call WriteAt with the current offset
168 return fh.writeAt(p, fh.offset)
169}
170
171// WriteString a string to the file
172func (fh *WriteFileHandle) WriteString(s string) (n int, err error) {

Callers 1

WriteStringMethod · 0.95

Calls 3

writeAtMethod · 0.95
LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected