user4867444
user4867444

Reputation: 243

What does syscall.Stat_t.Dev map to?

Golang's syscall.Stat_t has a Dev field, which I assume identifies the disk/device, see https://golang.org/src/syscall/ztypes_linux_amd64.go?s=1392:1688#L91

For example, for a syscall.Stat_t structure mapping to a file on my disk, Dev has value 51713; my question is: is that ID purely internal to Go? Or does it map to some OS ID (in which case, which one, and how can I see it with standard Unix CLI tools?)

Upvotes: 2

Views: 1025

Answers (1)

ppp
ppp

Reputation: 1005

syscall.Stat_t.Dev represents the ID of device on which the given file resides. So it's not internal to Go. You can find it using stat command like,

stat --format=%d <filename>

See this thread for more about device numbers.

Upvotes: 3

Related Questions