/// <summary> /// 创建一个文件夹 /// </summary> /// <param name="name"></param> public void CreateDirectory(String name) { VFS.AssertNameValid(name); INode inode = vfs.AllocateINode(1, 2333); if (!dir.Add(name, new INodeDirectory(vfs, inode))) { throw new Exception("创建文件夹失败"); } }
/// <summary> /// 通过创建一个新文件来初始化该类 /// </summary> /// <param name="vfs"></param> /// <param name="name"></param> /// <param name="dir"></param> private void CreateFile(INodeDirectory dir, String name) { inode = vfs.AllocateINode(0, 2333); dir.Add(name, inode); }