NewFilePool returns a Pool, 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)
| 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. |
| 87 | func NewFilePool(N int64, dir string) Pool { |
| 88 | return &filePool{N: N, Directory: dir} |
| 89 | } |
| 90 | |
| 91 | func (p *filePool) Get() (Buffer, error) { |
| 92 | file, err := ioutil.TempFile(p.Directory, "buffer") |
no outgoing calls
searching dependent graphs…