< 返回版块

jellybobbin 发表于 2020-03-12 14:27

Tags:树 结构 文件系统

自己弄了一个,总感觉不太对:

//文件类型 分常规型 和可执行类型
enum MyFileType{
    Eoutine,
    execute
}

//文件的属性  这里怎么样才好扩展
struct Attrabutes{
    
}

//文件
struct MyFile{
    name: String,
    file_type: MyFileType
    attrabutes: Attrabutes
}


//目录
struct MyDir{
    name: String,
    attrabutes: Attrabutes
}

//树 这里也感觉不太对
struct FileTree{
    file: Option<Vec<MyFile>>,
    dir: Option<Vec<MyDir>>
}

评论区

写评论
Ryan-Git 2020-03-12 22:40

看看 boost filesystem,java io file 呗

1 共 1 条评论, 1 页