Use copy file range from sysx
Use pooled buffers for copy Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
This commit is contained in:
parent
bb9f6b568d
commit
572dbcdbd4
3 changed files with 32 additions and 59 deletions
|
@ -4,10 +4,19 @@ import (
|
|||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
var (
|
||||
bufferPool = &sync.Pool{
|
||||
New: func() interface{} {
|
||||
return make([]byte, 32*1024)
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
// CopyDirectory copies the directory from src to dst.
|
||||
// Most efficient copy of files is attempted.
|
||||
func CopyDirectory(dst, src string) error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue