Skip to content

Instantly share code, notes, and snippets.

@Neo23x0
Created June 14, 2018 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Neo23x0/d0793f78700b46e5d203112ab9897ff7 to your computer and use it in GitHub Desktop.
Save Neo23x0/d0793f78700b46e5d203112ab9897ff7 to your computer and use it in GitHub Desktop.
Get File System Type
package main
import (
"fmt"
"os"
"syscall"
)
func main() {
if len(os.Args) != 2 {
fmt.Println("Usage: get_fs_type <path>")
os.Exit(0)
}
var buf syscall.Statfs_t
if err := syscall.Statfs(os.Args[1], &buf); err != nil {
fmt.Printf("Error: %s\n", err)
os.Exit(1)
}
fmt.Printf("%s: 0x%.8x\n", os.Args[1], int(buf.Type))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment