MCPcopy Create free account
hub / github.com/Recordscript/recordscript / ipc_path

Method ipc_path

libs/hbb_common/src/config.rs:648–673  ·  view source on GitHub ↗
(postfix: &str)

Source from the content-addressed store, hash-verified

646 }
647
648 pub fn ipc_path(postfix: &str) -> String {
649 #[cfg(windows)]
650 {
651 // \\ServerName\pipe\PipeName
652 // where ServerName is either the name of a remote computer or a period, to specify the local computer.
653 // https://docs.microsoft.com/en-us/windows/win32/ipc/pipe-names
654 format!(
655 "\\\\.\\pipe\\{}\\query{}",
656 *APP_NAME.read().unwrap(),
657 postfix
658 )
659 }
660 #[cfg(not(windows))]
661 {
662 use std::os::unix::fs::PermissionsExt;
663 #[cfg(target_os = "android")]
664 let mut path: PathBuf =
665 format!("{}/{}", *APP_DIR.read().unwrap(), *APP_NAME.read().unwrap()).into();
666 #[cfg(not(target_os = "android"))]
667 let mut path: PathBuf = format!("/tmp/{}", *APP_NAME.read().unwrap()).into();
668 fs::create_dir(&path).ok();
669 fs::set_permissions(&path, fs::Permissions::from_mode(0o0777)).ok();
670 path.push(format!("ipc{postfix}"));
671 path.to_str().unwrap_or("").to_owned()
672 }
673 }
674
675 pub fn icon_path() -> PathBuf {
676 let mut path = Self::path("icons");

Callers

nothing calls this directly

Calls 1

create_dirFunction · 0.85

Tested by

no test coverage detected