add customCudaFile support

This commit is contained in:
josc146
2023-05-23 14:04:06 +08:00
parent 65d92d5da1
commit 4eca1537a7
6 changed files with 56 additions and 3 deletions

View File

@@ -3,6 +3,7 @@ package backend_golang
import (
"encoding/json"
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
@@ -92,6 +93,26 @@ func (a *App) DeleteFile(path string) error {
return nil
}
func (a *App) CopyFile(src string, dst string) error {
sourceFile, err := os.Open(src)
if err != nil {
return err
}
defer sourceFile.Close()
destFile, err := os.Create(dst)
if err != nil {
return err
}
defer destFile.Close()
_, err = io.Copy(sourceFile, destFile)
if err != nil {
return err
}
return nil
}
func (a *App) OpenFileFolder(path string) error {
absPath, err := filepath.Abs(path)
if err != nil {