pub fn list_fds(&self) -> Option<Vec<usize>> {
        let mut vec: Vec<usize> = Vec::new();
        let path = String::from(format!("/proc/{}/fd", self.pid));
        let entries = fs::read_dir(&path).ok()?;
        for entry in entries {
            let fd: usize = entry
                .ok()?
                .path()
                .file_name()?
                .to_string_lossy()
                .into_owned()
                .parse::<usize>()
                .ok()?;
            vec.push(fd);
        }
        Some(vec)
    }
/// This function returns a list of file descriptor numbers for this Process, if that
/// information is available (it will return None if the information is unavailable). The
/// information will commonly be unavailable if the process has exited. (Zombie processes
/// still have a pid, but their resources have already been freed, including the file
/// descriptor table.)
This function returns a list of file descriptor numbers for this Process, if that
information is available (it will return None if the information is unavailable). The
information will commonly be unavailable if the process has exited. (Zombie processes
still have a pid, but their resources have already been freed, including the file
descriptor table.)
This function returns a list of file descriptor numbers for this Process if that information is available ( it will return None if the information is unavailable ) . The information will commonly be unavailable if the process has exited . ( Zombie processes still have a pid but their resources have already been freed including the file descriptor table . )
pub fn list_fds(&self) -> Option<Vec<usize>> {
        let mut vec: Vec<usize> = Vec::new();
        let path = String::from(format!("/proc/{}/fd", self.pid));
        let entries = fs::read_dir(&path).ok()?;
        for entry in entries {
            let fd: usize = entry
                .ok()?
                .path()
                .file_name()?
                .to_string_lossy()
                .into_owned()
                .parse::<usize>()
                .ok()?;
            vec.push(fd);
        }
        Some(vec)
    }
pub fn list_fds ( & self ) -> Option < Vec < usize > > { let mut vec : Vec < usize > = Vec :: new ( ) ; let path = String :: from ( format ! ( " " self pid ) ) ; let entries = fs :: read_dir ( & path ) . ok ( ) ? ; for entry in entries { let fd : usize = entry . ok ( ) ? . path ( ) . file_name ( ) ? . to_string_lossy ( ) . into_owned ( ) . parse :: < usize > ( ) . ok ( ) ? ; vec . push ( fd ) ; } Some ( vec ) }
This function returns a list of file descriptor numbers for this Process, if that
information is available (it will return None if the information is unavailable).
This function returns a list of file descriptor numbers for this Process if that information is available ( it will return None if the information is unavailable ) .
&self
&self