跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

storage_volume_linux.go

21 行 · 669 B历史下载
1package cage
2
3import (
4 "errors"
5
6 "golang.org/x/sys/unix"
7)
8
9func localStorageVolume(path string) error {
10 var info unix.Statfs_t
11 if err := unix.Statfs(path, &info); err != nil {
12 return err
13 }
14 // Only admit filesystems with local disk, private mode and sparse-file
15 // semantics. FUSE in particular may represent a remote mount.
16 switch uint32(info.Type) {
17 case unix.EXT4_SUPER_MAGIC, unix.XFS_SUPER_MAGIC, unix.BTRFS_SUPER_MAGIC, unix.F2FS_SUPER_MAGIC, unix.OVERLAYFS_SUPER_MAGIC, 0x2fc12fc1 /* zfs */, 0xca451a4e /* bcachefs */ :
18 return nil
19 }
20 return errors.New("请选择支持私有权限和稀疏文件的本地磁盘(例如 ext4、XFS 或 Btrfs)")
21}