You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
398 B
Go
26 lines
398 B
Go
package fuse
|
|
|
|
import (
|
|
"bytes"
|
|
"fmt"
|
|
"os/exec"
|
|
)
|
|
|
|
func unmount(dir string) error {
|
|
fusermount, err := findFusermount()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
cmd := exec.Command(fusermount, "-u", dir)
|
|
output, err := cmd.CombinedOutput()
|
|
if err != nil {
|
|
if len(output) > 0 {
|
|
output = bytes.TrimRight(output, "\n")
|
|
return fmt.Errorf("%v: %s", err, output)
|
|
}
|
|
|
|
return err
|
|
}
|
|
return nil
|
|
}
|