|
@@ -287,7 +287,6 @@ func GetDirectorySizeNative(filename string) (int64, error) {
|
|
//du command exists
|
|
//du command exists
|
|
//use native syscall to get disk size
|
|
//use native syscall to get disk size
|
|
cmd := exec.Command("du", "-sb", abspath)
|
|
cmd := exec.Command("du", "-sb", abspath)
|
|
- fmt.Println("du", "-sb", abspath)
|
|
|
|
out, err := cmd.CombinedOutput()
|
|
out, err := cmd.CombinedOutput()
|
|
if err != nil {
|
|
if err != nil {
|
|
return 0, err
|
|
return 0, err
|
|
@@ -304,14 +303,12 @@ func GetDirectorySizeNative(filename string) (int64, error) {
|
|
|
|
|
|
chunks := strings.Split(tmp, " ")
|
|
chunks := strings.Split(tmp, " ")
|
|
if len(chunks) <= 1 {
|
|
if len(chunks) <= 1 {
|
|
- fmt.Println(chunks)
|
|
|
|
return 0, errors.New("malformed output")
|
|
return 0, errors.New("malformed output")
|
|
}
|
|
}
|
|
|
|
|
|
//The first chunk should be the size in bytes
|
|
//The first chunk should be the size in bytes
|
|
size, err := strconv.Atoi(chunks[0])
|
|
size, err := strconv.Atoi(chunks[0])
|
|
if err != nil {
|
|
if err != nil {
|
|
- fmt.Println(err.Error())
|
|
|
|
return 0, errors.New("malformed output")
|
|
return 0, errors.New("malformed output")
|
|
}
|
|
}
|
|
|
|
|