?? 列表5.18.txt
字號(hào):
【列表5.18】幫助函數(shù) ProcReadLink和調(diào)用他的函數(shù)。
// ProcReadLink - return the name of the file that the
// link points to.
function ProcReadLink (pid: __pid_t; const sFile: String): String;
var
buf : array [0..1024] of char;
iLen : Integer;
sFilename : String;
begin
sFilename := Format ('/proc/%d/%s', [pid, sFile]);
iLen := readlink (PChar(sFilename), buf, 1024);
if iLen = -1 then
iLen := 0;
buf[iLen] := #0;
Result := buf;
end;
// ProcGetCwd - return the process's current working directory.
function ProcGetCwd (pid: __pid_t): String;
begin
Result := ProcReadLink (pid, 'cwd');
end;
// ProcGetExe - return the name of the process's executable.
function ProcGetExe (pid: __pid_t): String;
begin
Result := ProcReadLink (pid, 'exe');
end;
// ProcGetRoot - return the process's root directory
function ProcGetRoot (pid: __pid_t): String;
begin
Result := ProcReadLink (pid, 'root');
end;
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -