17 lines
281 B
Go
17 lines
281 B
Go
package utils
|
|
|
|
import (
|
|
"fmt"
|
|
"os/exec"
|
|
)
|
|
|
|
func CloneFile(src, dst string) error {
|
|
cmd := exec.Command("juicefs", "clone", src, dst)
|
|
output, err := cmd.CombinedOutput()
|
|
if err != nil {
|
|
return fmt.Errorf("clone failed: %v, output: %s", err, string(output))
|
|
}
|
|
|
|
return nil
|
|
}
|