Skip to content

Conversation

@jfontsaballs
Copy link

#33

@jfontsaballs
Copy link
Author

Magic number for recognizing a GZip file found in https://stackoverflow.com/questions/6059302/how-to-check-if-a-file-is-gzip-compressed

Copy link
Owner

@Scarfsail Scarfsail left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please look at my comment regardning .gz extension detections. Otherwise looks good, thanks for the contribution!

{
using (TextReader sr = new StreamReader(fs, true))
var isGzip = false;
if (LogFileName.Contains(".gz"))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't be better to use EndsWith instead of Contains? I assume that we are interested only in files ending by .gz.
And I would also add StringComparer.OrdinalIgnoreCase option.

{
using (TextReader sr = new StreamReader(fs))
var isGzip = false;
if (fileName.Contains(".gz"))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same comment as above. Otherwise no comments, thanks for the PR! :)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants