File: unmount_linux.go

package info (click to toggle)
golang-github-jacobsa-fuse 0.0~git20150806.0.9a7512a-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, trixie
  • size: 584 kB
  • sloc: asm: 11; makefile: 4
file content (23 lines) | stat: -rw-r--r-- 349 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package fuse

import (
	"bytes"
	"fmt"
	"os/exec"
)

func unmount(dir string) (err error) {
	// Call fusermount.
	cmd := exec.Command("fusermount", "-u", dir)
	output, err := cmd.CombinedOutput()
	if err != nil {
		if len(output) > 0 {
			output = bytes.TrimRight(output, "\n")
			err = fmt.Errorf("%v: %s", err, output)
		}

		return
	}

	return
}