/// <summary> /// "Инициализирует" файловую систему /// </summary> /// <param name="hardDriverSize">размер диска в байтах</param> public FileSystem(int hardDriverSize) { HardDriverSize = hardDriverSize; ClusterSize = 4096; FAT = new FAT32(HardDriverSize / 4096); directoriesAndFiles = new object[FAT.TableSize]; // // Создаем корневой каталог // int clusterForRoot = FAT.GetNextFreeBlock(); Attributes rootAttributes = new Attributes(false, false, true, false, true, false); RootDirectoryCatalog = new CatalogEntry(rootAttributes, ClusterSize / 32, clusterForRoot, "\\", ""); directoriesAndFiles[clusterForRoot] = new Directory(RootDirectoryCatalog); CurrentDirectory = RootDirectoryCatalog; CreateDotFile dotFile = new CreateDotFile(this, clusterForRoot); dotFile.Execute(); }
/// <summary> /// Создаст команду "Прочитать директорию" /// </summary> /// <param name="fileSystem">ссылка на файловую систему</param> public ReadDirectory(FileSystem fileSystem) { FileSystem = fileSystem; currentDirectory = (Directory)FileSystem.directoriesAndFiles[FileSystem.CurrentDirectory.FirstBlockNumber]; fat = FileSystem.FAT; }