VirtualFileSystem.VFSCore.GetDevice C# (CSharp) Method

GetDevice() public method

获取此文件系统的存储介质操作对象
public GetDevice ( ) : AbstractDevice
return AbstractDevice
        public AbstractDevice GetDevice()
        {
            return device;
        }

Usage Example

Example #1
0
        /// <summary>
        /// 从存储介质中获取 inode
        /// </summary>
        /// <param name="vfs"></param>
        /// <param name="index"></param>
        /// <returns></returns>
        public static INode Load(VFSCore vfs, UInt32 index)
        {
            if (index >= vfs.GetSuperBlock().data.inodeCapacity)
            {
                throw new Exception("无效 inode 编号");
            }

            INode inode = null;

            if (inodeInstances.ContainsKey(index))
            {
                inode = inodeInstances[index];
                return(inode);
            }
            else
            {
                _INode data = vfs.GetDevice().Read <_INode>(GetPosition(vfs, index));
                inode = new INode(vfs, data, index);
                inodeInstances[index] = inode;
            }

            inode.data.accessTime = (UInt64)DateTime.Now.Ticks;
            inode.Save();
            return(inode);
        }
All Usage Examples Of VirtualFileSystem.VFSCore::GetDevice