Beispiel #1
0
        public override void Delete(IVfsNode child, DirectoryEntry dentry)
        {
            FAT fs = this.FileSystem as FAT;

            uint childBlock = (child as VfsDirectory).directoryCluster;

            FAT.DirectoryEntryLocation location = fs.FindEntry(new FAT.FatMatchClusterComparer(childBlock), this.directoryCluster);

            if (!location.Valid)
            {
                throw new System.ArgumentException();                  //throw new IOException ("Unable to delete directory because it is not empty");
            }
            fs.Delete(childBlock, directoryCluster, location.DirectoryIndex);
        }
Beispiel #2
0
        public override IVfsNode Lookup(string name)
        {
            FAT.DirectoryEntryLocation location = (FileSystem as VfsFileSystem).FAT.FindEntry(new FAT.FatEntityComparer(name), this.directoryCluster);

            if (!location.Valid)
            {
                return(null);
            }

            if (location.IsDirectory)
            {
                return(new VfsDirectory(FileSystem, location.Block));
            }
            else
            {
                return(new VfsFile(FileSystem, location.Block, location.DirectorySector, location.DirectoryIndex));
            }
        }