MCPcopy Create free account
hub / github.com/dtormoen/tsk-tsk / write_pid

Method write_pid

src/server/lifecycle.rs:33–41  ·  view source on GitHub ↗

Write current process PID to file

(&self)

Source from the content-addressed store, hash-verified

31
32 /// Write current process PID to file
33 pub fn write_pid(&self) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
34 let pid_file = self.tsk_env.pid_file();
35 let pid = process::id();
36
37 let mut file = fs::File::create(&pid_file)?;
38 file.write_all(pid.to_string().as_bytes())?;
39
40 Ok(())
41 }
42
43 /// Read PID from file
44 pub fn read_pid(&self) -> Option<u32> {

Callers 2

runMethod · 0.80
test_server_lifecycleFunction · 0.80

Calls 1

pid_fileMethod · 0.80

Tested by 1

test_server_lifecycleFunction · 0.64