Same accessing an entry comment - ZipWritableArchiveEntry.cs explicitly replaces the ZipEntry.cs definition of Parts with the exception...
WIP I'd guess.
WIP I'd guess.
protected override void SaveTo(Stream stream, CompressionInfo compressionInfo,
IEnumerable<ZipArchiveEntry> oldEntries,
IEnumerable<ZipArchiveEntry> newEntries)
{
using (var writer = new ZipWriter(stream, compressionInfo, string.Empty))
{
foreach (var entry in oldEntries.Concat(newEntries)
.Where(x => !x.IsDirectory))
{
using (var entryStream = entry.OpenEntryStream())
{
writer.Write(entry.FilePath, entryStream, entry.LastModifiedTime, string.Empty);
}
entry.Close();
}
}
}
Only change is the entry.Close() call.entryStream = reader.OpenEntryStream ();
if (entryStream.CanRead)
{
logfileParser.ProcessStream(entryStream);
}
}2.NextEntryForCurrentStream()
bei SharpCompress.Reader.AbstractReader
2.MoveToNextEntry()Stream stream = await GetStreamAsync(uri);
if (stream == null)
{
return null;
}
stream = new GZipStream(stream, CompressionMode.Decompress);
String textResult;
using (var streamReader = new StreamReader(stream))
{
textResult = await streamReader.ReadToEndAsync(); // Throws the exception
}
Here is the stacktrace: at SharpCompress.Compressor.Deflate.GZipStream.get_Length()
at System.IO.StreamReader.ReadToEnd()
at AsyncExtensions.<>c__DisplayClass12.<ReadToEndAsync>b__11()
at System.Threading.Tasks.Task`1.InvokeFuture(Object futureAsObj)
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
at System.Threading.Tasks.Task.ExecuteWithThreadLocal()
at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
at System.Threading.Tasks.TaskScheduler.TryExecuteTask(Task task)
at System.Threading.Tasks.ThreadPoolTaskScheduler.<.ctor>b__0(Object state)
at System.Threading.ThreadPool.WorkItem.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadPool.WorkItem.doWork(Object o)
at System.Threading.Timer.ring()
Best For Each file In archive.Entries
label1.Text = "Currently Unzipping: " & file.FilePath & "..."
If file.IsComplete = True Then
'Check off each item once it is actually finished extracting to its destination...
CheckedListBox.SetItemChecked(CheckedListBox.Items.IndexOf(file.FilePath), True)
End If
Next
[/code]Public diagPath As String
Public Sub ButtonTest_Click(sender As Object, e As EventArgs) Handles ButtonTest.Click
'OpenFileDialog1.ShowDialog()
'Dim diagPath As String = OpenFileDialog1.FileName.ToString
'Dim diagPath As String = ListBox1.SelectedItem.ToString
'Dim diagPath As String = TextBoxFilesPath.Text.ToString
'Dim diagPath As String = CheckedListBox1.CheckedItems.ToString
For Each diagPath2 In CheckedListBox1.CheckedItems
diagPath = diagPath2.ToString
ArchiveFactory.WriteToDirectory(diagPath, "C:\WiiShare\Uncomp", ExtractOptions.ExtractFullPath)
MsgBox("done")
Next
End Sub
To reiterate, if I call the OpenFileDialogue and use the filename as the ArchiveFactory.writetodirectory source path, it works. If I use any other method to define the source path, I get the ArgumentOutOfRangeException error. mscorlib.dll!System.ThrowHelper.ThrowArgumentOutOfRangeException(System.ExceptionArgument argument, System.ExceptionResource resource) Unknown
mscorlib.dll!System.BitConverter.ToInt16(byte[] value, int startIndex) Unknown
SharpCompress.dll!SharpCompress.IO.MarkingBinaryReader.ReadInt16() Unknown
SharpCompress.dll!SharpCompress.Common.Rar.Headers.RarHeader.ReadFromReader(SharpCompress.IO.MarkingBinaryReader reader) Unknown
SharpCompress.dll!SharpCompress.Common.Rar.Headers.RarHeader.Create(SharpCompress.IO.MarkingBinaryReader reader) Unknown
SharpCompress.dll!SharpCompress.Common.Rar.Headers.RarHeaderFactory.ReadNextHeader(System.IO.Stream stream) Unknown
SharpCompress.dll!SharpCompress.Common.Rar.Headers.RarHeaderFactory.ReadHeaders() Unknown
SharpCompress.dll!SharpCompress.Common.Rar.RarVolume.GetVolumeFileParts() Unknown
mscorlib.dll!System.Collections.Generic.List<SharpCompress.Common.Rar.RarFilePart>.List(System.Collections.Generic.IEnumerable<SharpCompress.Common.Rar.RarFilePart> collection) Unknown
System.Core.dll!System.Linq.Enumerable.ToList<SharpCompress.Common.Rar.RarFilePart>(System.Collections.Generic.IEnumerable<SharpCompress.Common.Rar.RarFilePart> source) Unknown
SharpCompress.dll!SharpCompress.Utility.ToReadOnly<SharpCompress.Common.Rar.RarFilePart>(System.Collections.Generic.IEnumerable<SharpCompress.Common.Rar.RarFilePart> items) Unknown
SharpCompress.dll!SharpCompress.Archive.Rar.FileInfoRarArchiveVolume.FileInfoRarArchiveVolume(System.IO.FileInfo fileInfo, SharpCompress.Common.Options options) Unknown
SharpCompress.dll!SharpCompress.Archive.Rar.RarArchiveVolumeFactory.GetParts() Unknown
SharpCompress.dll!SharpCompress.LazyReadOnlyCollection<SharpCompress.Common.Rar.RarVolume>.LazyLoader.MoveNext() Unknown
SharpCompress.dll!SharpCompress.Archive.Rar.RarArchiveEntryFactory.GetFileParts() Unknown
SharpCompress.dll!SharpCompress.Archive.Rar.RarArchiveEntryFactory.GetMatchedFileParts() Unknown
SharpCompress.dll!SharpCompress.Archive.Rar.RarArchiveEntryFactory.GetEntries() Unknown
SharpCompress.dll!SharpCompress.LazyReadOnlyCollection<SharpCompress.Archive.Rar.RarArchiveEntry>.LazyLoader.MoveNext() Unknown
SharpCompress.dll!SharpCompress.Archive.ArchiveFactory.WriteToDirectory(string sourceArchive, string destinationDirectory, SharpCompress.Common.ExtractOptions options) Unknown
> defraggg.exe!defraggg.Form1.ButtonTest_Click(Object sender, System.EventArgs e) Line 96 Basic
System.Windows.Forms.dll!System.Windows.Forms.Control.OnClick(System.EventArgs e) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Button.OnClick(System.EventArgs e) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Button.OnMouseUp(System.Windows.Forms.MouseEventArgs mevent) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.WmMouseUp(ref System.Windows.Forms.Message m, System.Windows.Forms.MouseButtons button, int clicks) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.ButtonBase.WndProc(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Button.WndProc(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) Unknown
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr hWnd, int msg, System.IntPtr wparam, System.IntPtr lparam) Unknown
[Native to Managed Transition]
[Managed to Native Transition]
System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(System.IntPtr dwComponentID, int reason, int pvLoopData) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason, System.Windows.Forms.ApplicationContext context) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context) Unknown
System.Windows.Forms.dll!System.Windows.Forms.Application.Run(System.Windows.Forms.ApplicationContext context) Unknown
Microsoft.VisualBasic.dll!Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() Unknown
Microsoft.VisualBasic.dll!Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() Unknown
Microsoft.VisualBasic.dll!Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(string[] commandLine) Unknown
[Native to Managed Transition]
mscorlib.dll!System.AppDomain.ExecuteAssembly(string assemblyFile, System.Security.Policy.Evidence assemblySecurity, string[] args) Unknown
Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() Unknown
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state) Unknown
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() Unknown
to clarify a little more. This works fine:OpenFileDialog1.ShowDialog()
Dim diagPath As String = OpenFileDialog1.FileName.ToString
ArchiveFactory.WriteToDirectory(diagPath, "C:\WiiShare\Uncomp", ExtractOptions.ExtractFullPath)
I can open an OpenFileDialog box and pass the file path, as a string (diagPath), to ArchiveFactory.WriteToDirectory. No problems. All I have to do is pick the .rar file and it picks up the whole collection.Dim diagPath As String = ListBox1.SelectedItem.ToString
ArchiveFactory.WriteToDirectory(diagPath, "C:\WiiShare\Uncomp", ExtractOptions.ExtractFullPath)
It won't. When I pause to debug, the file path is a string, for sure. I have the listbox set to make single selections only. I have even tried to pass the filepath to a textbox, then to a string variable, and then into ArchiveFactory.