예제 #1
0
 internal DiskImageFile(FileLocator locator, string path, Stream stream, Ownership ownsStream)
     : this(stream, ownsStream)
 {
     _fileLocator = locator.GetRelativeLocator(locator.GetDirectoryFromPath(path));
     _fileName    = locator.GetFileFromPath(path);
 }
예제 #2
0
 internal DiskImageFile(FileLocator locator, string path, Stream stream, Ownership ownsStream)
     : this(stream, ownsStream)
 {
     _fileLocator = locator.GetRelativeLocator(locator.GetDirectoryFromPath(path));
     _fileName = locator.GetFileFromPath(path);
 }
예제 #3
0
        internal DiskImageFile(FileLocator locator, string path, FileAccess access)
        {
            FileShare share = access == FileAccess.Read ? FileShare.Read : FileShare.None;
            _fileStream = locator.Open(path, FileMode.Open, access, share);
            _ownsStream = Ownership.Dispose;

            try
            {
                _fileLocator = locator.GetRelativeLocator(locator.GetDirectoryFromPath(path));
                _fileName = locator.GetFileFromPath(path);

                ReadFooter(true);

                ReadHeaders();
            }
            catch
            {
                _fileStream.Dispose();
                throw;
            }
        }
        internal DiskImageFile(FileLocator locator, string path, FileAccess access)
        {
            FileShare share = access == FileAccess.Read ? FileShare.Read : FileShare.None;
            _fileStream = locator.Open(path, FileMode.Open, access, share);
            _ownsStream = Ownership.Dispose;

            _fileLocator = locator.GetRelativeLocator(locator.GetDirectoryFromPath(path));
            _fileName = locator.GetFileFromPath(path);

            Initialize();
        }