Class FstatUtil
java.lang.Object
oshi.util.common.platform.unix.netbsd.FstatUtil
Reads from fstat and related utilities on NetBSD.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetCwd(int pid) Gets current working directory info.static longgetOpenFiles(int pid) Gets open number of files.static StringparseCwdFromFstat(List<String> fstatLines) Parsesfstat -p <pid>output to find thewdrow and return the path column.static longparseOpenFiles(List<String> fstatLines) Counts open file descriptor rows infstat -p <pid>output (ignoring the header).
-
Method Details
-
getCwd
Gets current working directory info.- Parameters:
pid- a process ID- Returns:
- the current working directory for that process.
-
parseCwdFromFstat
-
getOpenFiles
public static long getOpenFiles(int pid) Gets open number of files.- Parameters:
pid- The process ID- Returns:
- the number of open files.
-
parseOpenFiles
-