public void FormatPartition(int index, string format, bool quick = true) { var part = Partitions[index]; var xSize = (long)(Host.BlockCount * Host.BlockSize / 1024 / 1024); if (format.StartsWith("FAT")) { FatFileSystem.CreateFatFileSystem(part.Host, VFSManager.GetNextFilesystemLetter() + ":\\", xSize, format); Mount(); } else { throw new NotImplementedException(format + " formatting not supported."); } }
/// <summary> /// Create new FileSystem /// </summary> /// <param name="aDriveId">A drive id.</param> /// <param name="aDriveFormat">A drive format.</param> private void CreateNewFileSystem(string aDriveId, string aDriveFormat) { var id = int.Parse(aDriveId); if (id < 0 || id >= mPartitions.Count) { throw new Exception("Can't find partition."); } var partition = mPartitions[id]; var xSize = (long)(partition.BlockCount * partition.BlockSize / 1024 / 1024); if (aDriveFormat.StartsWith("FAT")) { var fs = FatFileSystem.CreateFatFileSystem(partition, id + ":\\", xSize, aDriveFormat); mFileSystems.Add(fs); } else { throw new NotImplementedException(aDriveFormat + " formatting not supported."); } }