use WriteToDirectory method to RarArchiveEntry,throw NotImplementedException,but uncompress success,is it bug ? #608

Open
opened 2026-01-29 22:14:34 +00:00 by claunia · 4 comments
Owner

Originally created by @zhangqi-ulua on GitHub (Jan 3, 2024).

ExtractionOptions extractionOptions = new ExtractionOptions();
extractionOptions.ExtractFullPath = true;
extractionOptions.Overwrite = true;
extractionOptions.PreserveAttributes = true;
extractionOptions.PreserveFileTime = true;

RarArchive archive = ArchiveFactory.Open(@“D:\test.rar”);
foreach (IArchiveEntry oneEntry in archive.Entries)
{
if(oneEntry.Key == "1.jpg")
oneEntry.WriteToDirectory(@"D:\result", extractionOptions);
}

throw System.NotImplementedException:“The method or operation is not implemented.”

but the file is really uncompress success.I think is BUG

Originally created by @zhangqi-ulua on GitHub (Jan 3, 2024). ExtractionOptions extractionOptions = new ExtractionOptions(); extractionOptions.ExtractFullPath = true; extractionOptions.Overwrite = true; extractionOptions.PreserveAttributes = true; extractionOptions.PreserveFileTime = true; RarArchive archive = ArchiveFactory.Open(@“D:\test.rar”); foreach (IArchiveEntry oneEntry in archive.Entries) { if(oneEntry.Key == "1.jpg") oneEntry.WriteToDirectory(@"D:\result\", extractionOptions); } throw System.NotImplementedException:“The method or operation is not implemented.” but the file is really uncompress success.I think is BUG
Author
Owner

@zhangqi-ulua commented on GitHub (Jan 3, 2024):

Also I found any rar file use WriteToFile is same (throw System.NotImplementedException:“The method or operation is not implemented.”but the file is really uncompress success)

@zhangqi-ulua commented on GitHub (Jan 3, 2024): Also I found any rar file use WriteToFile is same (throw System.NotImplementedException:“The method or operation is not implemented.”but the file is really uncompress success)
Author
Owner

@Erior commented on GitHub (Jan 4, 2024):

if you have the test file available we can have a look on why it gives not implemented. RAR support is not complete but mostly works.

@Erior commented on GitHub (Jan 4, 2024): if you have the test file available we can have a look on why it gives not implemented. RAR support is not complete but mostly works.
Author
Owner

@zhangqi-ulua commented on GitHub (Jan 5, 2024):

The reason I didn't upload a RAR attachment earlier is that for any RAR file, attempting to execute WriteToDirectory or WriteToFile on any of the entries throws a NotImplementedException, even though the files can be extracted normally. If you really need me to upload one, I can upload just any file(Since GitHub does not support uploading files in RAR format, I have placed the RAR test file inside a ZIP file for uploading.
test.zip
).

Additionally, I've encountered another issue. For any 7z file that contains a large number of files, a full extraction of the 7z file might take around 10 seconds, but if I use a foreach loop to execute WriteToFile for each entry, the total time taken is more than tenfold.

@zhangqi-ulua commented on GitHub (Jan 5, 2024): The reason I didn't upload a RAR attachment earlier is that for any RAR file, attempting to execute WriteToDirectory or WriteToFile on any of the entries throws a NotImplementedException, even though the files can be extracted normally. If you really need me to upload one, I can upload just any file(Since GitHub does not support uploading files in RAR format, I have placed the RAR test file inside a ZIP file for uploading. [test.zip](https://github.com/adamhathcock/sharpcompress/files/13836845/test.zip) ). Additionally, I've encountered another issue. For any 7z file that contains a large number of files, a full extraction of the 7z file might take around 10 seconds, but if I use a foreach loop to execute WriteToFile for each entry, the total time taken is more than tenfold.
Author
Owner

@Erior commented on GitHub (Jan 5, 2024):

The ExtractOptions above should work with the pull request I made.

I can add that NTFS ACL and UNIX owner handling is not implemented for RAR files, but does not trigger an exception

@Erior commented on GitHub (Jan 5, 2024): The ExtractOptions above should work with the pull request I made. I can add that NTFS ACL and UNIX owner handling is not implemented for RAR files, but does not trigger an exception
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#608