Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileInfo.ExtractGZipToDirectory Not Working #19

Open
adamfisher opened this issue Dec 20, 2018 · 5 comments
Open

FileInfo.ExtractGZipToDirectory Not Working #19

adamfisher opened this issue Dec 20, 2018 · 5 comments
Assignees

Comments

@adamfisher
Copy link
Contributor

I was unable to get ExtractGZipToDirectory() working. It just created an empty file when I tried to decompress it. I ended up creating this method which did work:

private static FileInfo DecompressGZipFile(this FileInfo compressedFilePath)
{
	using (var fs = compressedFilePath.OpenRead())
	{
		using (var zipStream = new GZipStream(fs, CompressionMode.Decompress))
		{
			var buffer1 = compressedFilePath.Name.Split('.');
			var buffer2 = buffer1[0] + "." + buffer1[1];
			var filePath = Path.Combine(compressedFilePath.DirectoryName, buffer2);

			using (var fOutStream = new FileStream(filePath, FileMode.Create, FileAccess.Write))
			{
				var tempBytes = new byte[4096];
				int i;
				while ((i = zipStream.Read(tempBytes, 0, tempBytes.Length)) != 0)
				{
					fOutStream.Write(tempBytes, 0, i);
				}
			}

			return new FileInfo(filePath);
		}
	}
}
@prasadtelkikar
Copy link

@adamfisher ,I am new to this repo. I would like to contribute to this project.
Can you please provide me steps to reproduce this issue.

@JonathanMagnan JonathanMagnan self-assigned this Dec 21, 2018
@JonathanMagnan
Copy link
Member

Hello @adamfisher , @prasadtelkikar ,

Thank you for reporting and your interest.

It has been a long time since the last time we really make a big change to this project. However, I still use it on a daily usage so that's for sure a project I would like to keep up to date.

I will discuss with my team and check about the future of this project and what we could plan for it.

Best Regards,

Jonathan

@JonathanMagnan
Copy link
Member

Hello @adamfisher , @prasadtelkikar ,

Just to let you know what has been decided yesterday,

We finally choose to have a developer dedicated to the document in January and create a website for the documentation about our extensions methods.

Every extension methods will come with documentation and an online example using https://dotnetfiddle.net/ whenever we can.

Once the documentation is completed (or we believe enough extension has been documented), we will start to support again this library by adding some new methods/merging pull.

If you get the information you need @prasadtelkikar to fix it, feel free to provide a pull request.

As said, on our side, we will start first with the documentation for the next 1-2 months before starting to add more extensions or provide support.
Best Regards,

Jonathan

@adamfisher
Copy link
Contributor Author

@adamfisher ,I am new to this repo. I would like to contribute to this project.
Can you please provide me steps to reproduce this issue.

Just try using the ExtractGZipToDirectory() extension method on any zipped file and it fails.

@adamfisher
Copy link
Contributor Author

@prasadtelkikar Any movement on this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants