mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
Error: "Index was outside the bounds of the array." #161
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @fahmiandhika on GitHub (Mar 21, 2017).
Hi Guys,
I Have an error "Index was outside the bounds of the array." when to try extract file.
below the code
` using (Stream stream = System.IO.File.OpenRead(pathForZip))
using (var reader = ReaderFactory.Open(stream))
{
while (reader.MoveToNextEntry())
{
if (!reader.Entry.IsDirectory)
{
Console.WriteLine(reader.Entry.Key);
reader.WriteEntryToDirectory(pathForExtracting, new ExtractionOptions()
{
ExtractFullPath = true,
Overwrite = true
});
}
Please advice,
Thanks
@adamhathcock commented on GitHub (Mar 21, 2017):
Need a stack trace and possibly a sample file
@fahmiandhika commented on GitHub (Mar 21, 2017):
here is the stack trace:
at SharpCompress.Compressors.Rar.Unpack20.CopyString20(Int32 Length, Int32 Distance)
at SharpCompress.Compressors.Rar.Unpack20.unpack20(Boolean solid)
at SharpCompress.Compressors.Rar.Unpack.doUnpack()
at SharpCompress.Compressors.Rar.RarStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at SharpCompress.Common.EntryStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at SharpCompress.Common.EntryStream.SkipEntry()
at SharpCompress.Common.EntryStream.Dispose(Boolean disposing)
at System.IO.Stream.Close()
at System.IO.Stream.Dispose()
at SharpCompress.Readers.AbstractReader
2.Write(Stream writeStream) at SharpCompress.Readers.AbstractReader2.WriteEntryTo(Stream writableStream)at SharpCompress.Readers.IReaderExtensions.WriteEntryToFile(IReader reader, String destinationFileName, ExtractionOptions options)
at SharpCompress.Readers.IReaderExtensions.WriteEntryToDirectory(IReader reader, String destinationDirectory, ExtractionOptions options)
at ebudget.Controllers.UploadADKController.d__5.MoveNext() in D:\ebudget\EBudgeting\ebudget\ebudget\Controllers\UploadADKController.cs:line 149
@fahmiandhika commented on GitHub (Mar 21, 2017):
sorry, I can't upload the sample u ask
system said : "We don't support that file type", besides my file extensions is ZIP
@adamhathcock commented on GitHub (Mar 21, 2017):
Are you sure it's a zip? Try using
ZipReader.Openor evenZipArchive.Openand see what happens.@fahmiandhika commented on GitHub (Mar 22, 2017):
I Don't know.
the file was generated by fox pro application.And the extension is .s17.
but, when I renamed the extension to zip, and try to extract it by windows (used winrar), it was success.
@adamhathcock commented on GitHub (Mar 22, 2017):
I really have no idea what file type that is. The archive detection seems to think it is a RAR file but I couldn't tell you why.
I'm going to have to say I'm not going to support this scenario unless you can give me more information. I know nothing about Fox Pro.
@fahmiandhika commented on GitHub (Mar 23, 2017):
FYI,
Not all of files failed to extract. Only some files (2 of 10)
and the failed file only extract some part (4048 kb from 7100kb)
@fahmiandhika commented on GitHub (May 22, 2017):
hello, I still find this issue.
in exception, it said : _COMPlusExceptionCode = -532462766
I have searching that code in google, but not found .
Thanks
@adamhathcock commented on GitHub (May 22, 2017):
Need something more as there's no COM in this library. Stack trace?
@fahmiandhika commented on GitHub (May 22, 2017):
https://drive.google.com/file/d/0B3ZUDPG-OCyNRHExRTI3ckpKWk0/view?usp=sharing
that is the sample file cannot extract.
Anyway, is there any Dependency with my hardware? or some thing must be set?
I have only 4GB RAM.
@adamhathcock commented on GitHub (May 23, 2017):
I've tried this file. It seems to think it's a RAR file. But maybe it's not. I have no idea what this is.
@th3w1zard1 commented on GitHub (Aug 31, 2023):
Same problem here. I've had to fallback to 7z.dll in cases where this could happen.
Here's another archive with the problem:
https://deadlystream.com/files/file/585-coruscant-jedi-temple-by-deathdisco/
Strangely, 7zip doesn't output any errors or any problems at all.
@adamhathcock commented on GitHub (Sep 7, 2023):
Looking at this file, slowly
@Nanook commented on GitHub (Feb 6, 2025):
I'll push a PR for this in a day or 2. It was raised in my app. It's getting tested on a bunch of archives from back in the day now.