Beispiel #1
0
 public FatDataStream(FatFileSystem fat, DirectoryEntry entry, bool ignoreSize) : this(fat, (uint)(entry.fstClusHI << 16) | entry.fstClusLO)
 {
     if (!ignoreSize)
     {
         _length = entry.fileSize;
     }
 }
Beispiel #2
0
 public FatDataStream(FatFileSystem fat, uint firstCluster)
 {
     _fat      = fat;
     _base     = fat.GetStream();
     _clusters = fat.GetClusterChain(firstCluster);
     _length   = (uint)_clusters.Length * fat.BytesPerCluster;
 }
Beispiel #3
0
        public static IEnumerable <DirectoryEntry> ReadRootDirectory(FatFileSystem fat, bool includeDeleted = false)
        {
            var stream = fat.GetStream();

            stream.Position = (fat.ReservedSectors + fat.ClusterMapsSectors) * fat.BiosParameterBlock.BytesPerLogicalSector;

            return(ReadDirectory(stream, fat.BiosParameterBlock.RootDirectoryEntries, includeDeleted));
        }
Beispiel #4
0
 public FatDirectory(FatFileSystem fat, DirectoryEntry entry, LongDirectoryEntry[]?lfnEntries, Directory parent) : base(fat, parent)
 {
     this.entry      = entry;
     this.lfnEntries = lfnEntries;
 }
Beispiel #5
0
 public FatDirectory(FatFileSystem fat) : base(fat, null)
 {
 }
Beispiel #6
0
 public static IEnumerable <DirectoryEntry> ReadSubdirectory(FatFileSystem fat, uint cluster, bool includeDeleted = false)
 => ReadDirectory(new FatDataStream(fat, cluster), int.MaxValue, includeDeleted);
Beispiel #7
0
 public FatDataStream(FatFileSystem fat, DirectoryEntry entry) : this(fat, entry, false)
 {
 }
Beispiel #8
0
 public FatFile(FatFileSystem fat, DirectoryEntry entry, LongDirectoryEntry[]?lfnEntries, Directory dir) : base(fat, dir)
 {
     this.entry      = entry;
     this.lfnEntries = lfnEntries;
 }