public FileFAT(FileSystemFAT fileSystem, FolderFAT.DirectoryEntry entry, string path) {
			FileSystem = fileSystem;
			Name = PathUtils.MakeFileNameValid(entry.FileName);
			Path = PathUtils.Combine(path, Name);
			_length = entry.Length;
			Attributes = new FileAttributesFAT(entry);
			FirstCluster = entry.ClusterNum;
			Deleted = Attributes.Deleted;
		}
Example #2
0
 public FileFAT(FileSystemFAT fileSystem, FolderFAT.DirectoryEntry entry, string path)
 {
     FileSystem   = fileSystem;
     Name         = PathUtils.MakeFileNameValid(entry.FileName);
     Path         = PathUtils.Combine(path, Name);
     _length      = entry.Length;
     Attributes   = new FileAttributesFAT(entry);
     FirstCluster = entry.ClusterNum;
     Deleted      = Attributes.Deleted;
 }
Example #3
0
 public FolderFAT(FileSystemFAT fileSystem, DirectoryEntry entry, string path)
 {
     _root        = false;
     FileSystem   = fileSystem;
     Offset       = entry.Offset;
     FirstCluster = entry.ClusterNum;
     Name         = PathUtils.MakeFileNameValid(entry.FileName);
     Path         = PathUtils.Combine(path, Name);
     Loaded       = false;
     Attributes   = new FileAttributesFAT(entry);
     Deleted      = Attributes.Deleted;
 }
Example #4
0
 public FolderFAT(FileSystemFAT fileSystem, long offset, long cluster)
 {
     _root        = true;
     Offset       = offset;
     FileSystem   = fileSystem;
     FirstCluster = cluster;
     Name         = GetVolumeName();
     Path         = FileSystem.Store.DeviceID;
     Loaded       = false;
     Attributes   = new FileAttributesFAT();
     Deleted      = Attributes.Deleted;
 }
		public FileFAT(FileSystemFAT fileSystem, long firstCluster) {
			FileSystem = fileSystem;
			FirstCluster = firstCluster;
			Name = Util.GetRandomString(8);
			Path = PathUtils.Combine(FileSystem.Store.DeviceID, "?", Name);
			long currentCluster = FirstCluster;
			_length = 0;
			while (currentCluster >= 0) {
				// Note: This won't correctly calculate the length of a deleted file.
				currentCluster = FileSystem.GetNextCluster(currentCluster);
				_length += FileSystem.BytesPerCluster;
			}
			Attributes = new FileAttributesFAT();
			Deleted = true;
		}
Example #6
0
        public FileFAT(FileSystemFAT fileSystem, long firstCluster)
        {
            FileSystem   = fileSystem;
            FirstCluster = firstCluster;
            Name         = Util.GetRandomString(8);
            Path         = PathUtils.Combine(FileSystem.Store.DeviceID, "?", Name);
            long currentCluster = FirstCluster;

            _length = 0;
            while (currentCluster >= 0)
            {
                // Note: This won't correctly calculate the length of a deleted file.
                currentCluster = FileSystem.GetNextCluster(currentCluster);
                _length       += FileSystem.BytesPerCluster;
            }
            Attributes = new FileAttributesFAT();
            Deleted    = true;
        }
		public FolderFAT(FileSystemFAT fileSystem, DirectoryEntry entry, string path) {
			_root = false;
			FileSystem = fileSystem;
			Offset = entry.Offset;
			FirstCluster = entry.ClusterNum;
			Name = PathUtils.MakeFileNameValid(entry.FileName);
			Path = PathUtils.Combine(path, Name);
			Loaded = false;
			Attributes = new FileAttributesFAT(entry);
			Deleted = Attributes.Deleted;
		}
		public FolderFAT(FileSystemFAT fileSystem, long offset, long cluster) {
			_root = true;
			Offset = offset;
			FileSystem = fileSystem;
			FirstCluster = cluster;
			Name = GetVolumeName();
			Path = FileSystem.Store.DeviceID;
			Loaded = false;
			Attributes = new FileAttributesFAT();
			Deleted = Attributes.Deleted;
		}