#!/usr/bin/env tclsh
set version [open "/proc/version" r]
while {1} {
if {[chan gets $version line] > 0} {
puts $line
} else {
if {[chan eof $version]} {
break;
} else {
puts "Something is wrong."
break;
}
}
}
chan close $version
procfs
The proc filesystem (procfs) is a special filesystem in Unix-like operating systems that presents information about processes and other system information in a hierarchical file-like structure, providing a more convenient and standardized method for dynamically accessing process data held in the kernel than traditional tracing methods or direct access to kernel memory.
沒有留言:
張貼留言