write/edit tools fail on Google Drive Desktop virtual filesystem (Windows): SetFileSecurityW Win32 87 and link EISDIR #3919
Replies: 3 comments
|
Google Drive Desktop’s virtual FS does not support
|
|
根因定位得很准( 关于你现在的绕法,有个安全上的取舍值得说你的 workaround 是用 有一条范围更窄的路:挂一个 filesystem 类的 MCP server,只把需要写的那些目录交给它,模型用它的写工具落文件。那个 server 是独立进程,用普通的 但必须说清两件事,否则就是拿一个坑换另一个坑:
真正的修法还是在 DSH 这边你提的两处都很具体,而且看起来都能做成"探测到不支持就降级":
这类"虚拟/网络文件系统不支持硬链接"是很常见的边界,值得作为通用兼容性来处理,而不只是修 Google Drive。我们改不了 利益相关:我维护 pi2dsh(Pi 生态兼容层)。上面那条 MCP 方案用的是官方 |
|
Same
Suggested degradation matches this thread: skip DACL copy on UNC (and treat ACCESS_DENIED as inherit-from-share); skip No PR (CONTRIBUTING). Workaround: https://github.com/398894496-arch/TDHarness-coding marks 同类:公司 SMB(UNC)上是 Win32 5,不是 Drive 的 87。跳过 UNC 上的 DACL 拷贝 / |
Uh oh!
There was an error while loading. Please reload this page.
dsh version: 0.1.1-rc.2
OS: Windows + Google Drive Desktop (workspace on
G:\Meu Drive\..., virtual filesystem with cloud placeholders)Permission mode: tested with
workspace-writeanddanger-full-accessSymptoms
write(creating a new file) fails withEISDIR: illegal operation on a directory, link '<staging-dir>\<name>.tmp' -> '<target>'— the atomic publish uses a hard link (fs.promises.link), which the Google Drive virtual filesystem does not support.edit(overwriting an existing file) fails withSetFileSecurityW EIO (Win32 87): <staging-dir>\<name>.tmp— before writing, the file's DACL is copied to the staging file via Win32SetFileSecurityW, which returnsERROR_INVALID_PARAMETERon the Drive virtual filesystem.pwshunderworkspace-writefails to initialize:SetNamedSecurityInfoW failed (Win32 87): grantWrite('<workspace>')— the ACL-grant step fails on the virtual filesystem.danger-full-accessand write files directly (PowerShellSet-Content, Pythonopen(path, 'wb')). Read-only tools (read/grep/glob) and git work normally. Tools that write directly (Claude Code, Obsidian) work fine on the same folder.Root cause
In
@deepseek-ai/dsh-fs-local/lib/index.js,writeFileAtomic:if (platform === "win32" && mode !== void 0) await copyFileDacl(absolutePath, tempPath)→SetFileSecurityW(path, 2147483652 /* DACL + PROTECTED_DACL */, descriptor).await linkFile(tempPath, absolutePath)on thecreateIfAbsent(new-file) publish path.internals.copyFileDacl/internals.linkFileoverrides are test hooks only — there is no user-facing configuration to disable the ACL copy or the hard-link publish.Impact
On Windows, any workspace synced by Google Drive (and likely OneDrive/iCloud) cannot use the built-in file tools at all: both creating and editing files fail. This forces a shell/Python workaround for every file operation, or abandoning cloud-synced workspaces — a very common setup (Obsidian vaults, code repos on Drive).
Suggested fix (graceful degradation)
GetFileSecurityW/SetFileSecurityWin try/catch; on failure (Win32 87, 5, 6) log a warning and continue — the staging file inherits the parent directory's ACL anyway.link()is unsupported: copy the staged file withopen(dest, 'wx')+ write + rename whenlinkthrowsEISDIR/EPERM/ENOTSUP.All reactions