MCPcopy Create free account
hub / github.com/djherbis/buffer / NewFilePoolAt

Function NewFilePoolAt

pool_at.go:87–89  ·  view source on GitHub ↗

NewFilePoolAt returns a PoolAt, Get() returns a file-based buffer of max size N. Put() closes and deletes the underlying file for the buffer. Get() may return an error if it fails to create a file for the buffer. Put() may return an error if it fails to delete the file.

(N int64, dir string)

Source from the content-addressed store, hash-verified

85// Get() may return an error if it fails to create a file for the buffer.
86// Put() may return an error if it fails to delete the file.
87func NewFilePoolAt(N int64, dir string) PoolAt {
88 return &filePoolAt{N: N, Directory: dir}
89}
90
91func (p *filePoolAt) Get() (BufferAt, error) {
92 file, err := ioutil.TempFile(p.Directory, "buffer")

Callers 1

TestWriteAtFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestWriteAtFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…