Created
June 14, 2018 17:29
-
-
Save Neo23x0/d0793f78700b46e5d203112ab9897ff7 to your computer and use it in GitHub Desktop.
Get File System Type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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