is_ipc_file_exist quote Config::ipc_path (#8295)
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
parent
ffac670f95
commit
57570c3ba6
@ -972,9 +972,11 @@ pub async fn test_rendezvous_server() -> ResultType<()> {
|
||||
|
||||
#[cfg(windows)]
|
||||
pub fn is_ipc_file_exist(suffix: &str) -> ResultType<bool> {
|
||||
let file_name = format!("{}\\query{}", crate::get_app_name(), suffix);
|
||||
// Not change this to std::path::Path::exists, unless it can be ensured that it can find the ipc which occupied by a process that taskkill can't kill.
|
||||
let prefix = "\\\\.\\pipe\\";
|
||||
let file_name = Config::ipc_path(suffix).replace(prefix, "");
|
||||
let mut err = None;
|
||||
for entry in std::fs::read_dir("\\\\.\\pipe\\")? {
|
||||
for entry in std::fs::read_dir(prefix)? {
|
||||
match entry {
|
||||
Ok(entry) => {
|
||||
if entry.file_name().into_string().unwrap_or_default() == file_name {
|
||||
|
Loading…
x
Reference in New Issue
Block a user