is there a reliable cross-platform method for testing if a file is compressed?

  • Thread starter it_says_BALLS_on_your_forehead
  • Start date
I

it_says_BALLS_on_your_forehead

I've tried using Solaris's 'file' command, which seems to work ok on my
2 sample files, but on AIX, I get different results for two different
files that are gzipped.

One result reads : gzip (.gz) compressed data
The second is : data or International Language text

both files are gzipped.

....so, I was wondering if there existed a reliable, consistent way of
testing the file_type of a file within Perl that would not vary across
OS.
 
R

Randal L. Schwartz

it> ...so, I was wondering if there existed a reliable, consistent way of
it> testing the file_type of a file within Perl that would not vary across
it> OS.

You mean, *besides* File::Mimeinfo, which a simple CPAN search
would have shown you?

If you didn't look, shame on you.

If you *did* look, what's wrong with that module?

print "Just another Perl hacker,"; # the original
 
I

it_says_BALLS_on_your_forehead

Randal said:
it> ...so, I was wondering if there existed a reliable, consistent way of
it> testing the file_type of a file within Perl that would not vary across
it> OS.

You mean, *besides* File::Mimeinfo, which a simple CPAN search
would have shown you?

If you didn't look, shame on you.

Shame on me.

I'll check it out. Thanks Randall.
 
I

it_says_BALLS_on_your_forehead

Randal said:
it> ...so, I was wondering if there existed a reliable, consistent way of
it> testing the file_type of a file within Perl that would not vary across
it> OS.

You mean, *besides* File::Mimeinfo, which a simple CPAN search
would have shown you?

If you didn't look, shame on you.

Shame on me.

I'll check it out. Thanks Randal.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,691
Members
48,796
Latest member
Greg L.

Latest Threads

Top