AddParent() private method

添加父目录
private AddParent ( UInt32 inodeIndex ) : System.Boolean
inodeIndex System.UInt32
return System.Boolean
示例#1
0
        /// <summary>
        /// 添加一个目录目录项
        /// </summary>
        /// <param name="name"></param>
        /// <param name="dir"></param>
        /// <returns></returns>
        public Boolean Add(String name, INodeDirectory dir)
        {
            if (Contains(name))
            {
                return(false);
            }
            if (dir.Contains(".."))
            {
                return(false);
            }

            entries[name] = dir.inode.index;
            dir.inode.data.linkCount++;
            dir.inode.Save();
            dir.AddParent(inode.index);

            Save();
            return(true);
        }
示例#2
0
        /// <summary>
        /// 添加一个目录目录项
        /// </summary>
        /// <param name="name"></param>
        /// <param name="dir"></param>
        /// <returns></returns>
        public Boolean Add(String name, INodeDirectory dir)
        {
            if (Contains(name))
            {
                return false;
            }
            if (dir.Contains(".."))
            {
                return false;
            }

            entries[name] = dir.inode.index;
            dir.inode.data.linkCount++;
            dir.inode.Save();
            dir.AddParent(inode.index);

            Save();
            return true;
        }