I'm writing a program to parse data from /proc/pid/stat
, but don't know how to parse those fields using idiomatic rust. The second field can contain anything, including space and parenthesis.
/proc/pid/stat
look like this:
802359 (cat) R 728674 802359 728674 34824 802359 4194304 92 0 0 0 0 0 0 0 20 0 1 0 10550623 11358208 132 18446744073709551615 94492582699008 94492582716465 140732240338192 0 0 0 0 0 0 0 0 0 17 7 0 0 0 0 0 94492582734480 94492582736064 94492600344576 140732240341139 140732240341159 140732240341159 140732240343019 0