Commit 5857521b authored by Jakob Unterwurzacher's avatar Jakob Unterwurzacher

Add contrib/statfs tool

This should help debugging and ,

as MacOS does not have "stat -f".
parent cd7a6862
package main
import (
const (
myName = "statfs"
func main() {
flag.Usage = func() {
fmt.Fprintf(os.Stderr, "Usage: %s PATH\n", myName)
fmt.Fprintf(os.Stderr, "Dump the statfs information for PATH to the console, JSON format.\n")
if flag.NArg() != 1 {
path := flag.Arg(0)
var st syscall.Statfs_t
err := syscall.Statfs(path, &st)
if err != nil {
fmt.Fprintf(os.Stderr, "statfs syscall returned error: %v\n", err)
jsn, _ := json.MarshalIndent(st, "", "\t")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment