{"record":{"id":"f3396b76b78bf9e0","repo":"zed-industries/zed","slug":"granting-a-not-yet-existing-write-directory-is-not","errorCode":null,"errorMessage":"granting a not-yet-existing write directory is not supported on this platform","messagePattern":"granting a not-yet-existing write directory is not supported on this platform","errorType":"exception","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"crates/sandbox/src/sandbox.rs","lineNumber":1377,"sourceCode":"            let canonical_path = pinned_canonical_path(path)?;\n            Ok(Self {\n                canonical_path,\n                untrusted_raw_path,\n                eagerly_created,\n            })\n        }\n        #[cfg(target_os = \"macos\")]\n        {\n            Ok(Self {\n                canonical_path: canonicalize_allowing_missing_leaf(path),\n                untrusted_raw_path,\n                eagerly_created: Vec::new(),\n            })\n        }\n        #[cfg(not(any(target_os = \"linux\", target_os = \"macos\")))]\n        {\n            let _ = untrusted_raw_path;\n            Err(std::io::Error::new(\n                std::io::ErrorKind::Unsupported,\n                \"granting a not-yet-existing write directory is not supported on this platform\",\n            ))\n        }\n    }\n\n    /// The canonical, symlink-resolved path to show the user and record as the\n    /// grant.\n    pub fn canonical_path(&self) -> &Path {\n        &self.canonical_path\n    }\n\n    /// The path exactly as requested, for persisting alongside the canonical\n    /// path and for the \"requested → granted\" approval disclosure.\n    pub fn untrusted_raw_path(&self) -> &Path {\n        &self.untrusted_raw_path\n    }\n","sourceCodeStart":1359,"sourceCodeEnd":1395,"githubUrl":"https://github.com/zed-industries/zed/blob/5a9b9558db01a6b906cec2fb70a797affdc58cdd/crates/sandbox/src/sandbox.rs#L1359-L1395","documentation":"Sentinel validation error from the sandbox constructor for platforms other than Linux and macOS: eagerly granting write access to a directory that does not exist yet is only implemented for Linux and macOS. On any other target the Sandbox constructor rejects write paths that cannot be canonicalized ahead of time.","triggerScenarios":"Thrown at crates/sandbox/src/sandbox.rs:1377 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create the write directory before passing it as a sandbox write grant","Only grant directories that already exist when running on unsupported platforms","Add platform support if this platform needs eager directory creation"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5a9b9558db01a6b906cec2fb70a797affdc58cdd","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}