New Copy Function

This commit is contained in:
aditya-K2 2021-12-09 02:34:49 +05:30
parent 13b07bf7f7
commit 0bd47c5d3f
1 changed files with 14 additions and 0 deletions

View File

@ -1,6 +1,7 @@
package main
import (
"io/ioutil"
"strconv"
"strings"
"syscall"
@ -94,3 +95,16 @@ func formatString(a interface{}) string {
return "Paused"
}
}
func Copy(sourceImage, destinationImage string) error {
source, err := ioutil.ReadFile(sourceImage)
if err != nil {
return err
} else {
err = ioutil.WriteFile(destinationImage, source, 0644)
if err != nil {
return err
}
return nil
}
}