| Author |
Message |
Eskimo
Guest
|
Posted:
Tue Sep 21, 2004 12:33 am Post subject:
How to recognize a file type, based on it structure? |
|
|
In Linux systems, we have a tool, called 'file" that can help to discover
wich structure the file have.
Example: file <filename> returns, the type, based on structure, MP3,
EXEcutable for MS-DOS, Video and so on. The success rate is very high.
There is a tol, for Windows, that can do it by command-line?
I've tried TRID32, and besides intersting features like "learning" with new
files, the app fails several times, in recognize file types. I've tested
with various video files (asf, avi, mpeg) made by several different decoders
and in many files, Trid32 was unable to recognize the file extension. The
same files analyzed by "file" command in Linux, were successfull reconized
as video files.
Someone can suggest another app?
I have to write Batch Scripts to recognize files based on strucure (not on
file extenions), search for videos, music, etc, and delete them all to claim
free space on the server (The users learned that if they rename MP3 files to
..DOC, my Scrpts can't detect them) |
|
| Back to top |
|
 |
Tim Slattery
Guest
|
Posted:
Tue Sep 21, 2004 5:08 pm Post subject:
Re: How to recognize a file type, based on it structure? |
|
|
"Eskimo" <eskmo@iglu.net> wrote:
| Quote: | In Linux systems, we have a tool, called 'file" that can help to discover
wich structure the file have.
Example: file <filename> returns, the type, based on structure, MP3,
EXEcutable for MS-DOS, Video and so on. The success rate is very high.
There is a tol, for Windows, that can do it by command-line?
|
No.
| Quote: | I have to write Batch Scripts to recognize files based on strucure (not on
file extenions), search for videos, music, etc, and delete them all to claim
free space on the server (The users learned that if they rename MP3 files to
.DOC, my Scrpts can't detect them)
|
AFAIK, this can't be done.
--
Tim Slattery
MS MVP(DTS)
Slattery_T@bls.gov |
|
| Back to top |
|
 |
Dan Lovinger [MSFT]
Guest
|
Posted:
Wed Sep 22, 2004 1:27 am Post subject:
Re: How to recognize a file type, based on it structure? |
|
|
In the elder days, UNIX tools used a file /etc/magic which, in spite of its
name, was nothing like magic. It simply had a list of leading byte sequences
along with the file types. I don't know what the current tools use, but it
must be the same thing in a different location (and possibly a little more
involved). Folks are usually very good about making this kind of test work
with their file formats ...
If you look at these files, I think you will quickly spot identifying byte
sequences at or near the beginning of them. It'll have about the same risk
of false positives too since it is using the same technique - caveat emptor.
--
Dan Lovinger
Microsoft Corporation
Please do not send e-mail directly to this alias. This alias is for
newsgroup purposes only.
"Tim Slattery" <Slattery_T@bls.gov> wrote in message
news:st90l052pr1n49tonarmo7qo9sfj49teo0@4ax.com...
| Quote: | "Eskimo" <eskmo@iglu.net> wrote:
In Linux systems, we have a tool, called 'file" that can help to discover
wich structure the file have.
Example: file <filename> returns, the type, based on structure, MP3,
EXEcutable for MS-DOS, Video and so on. The success rate is very high.
There is a tol, for Windows, that can do it by command-line?
No.
I have to write Batch Scripts to recognize files based on strucure (not on
file extenions), search for videos, music, etc, and delete them all to
claim
free space on the server (The users learned that if they rename MP3 files
to
.DOC, my Scrpts can't detect them)
AFAIK, this can't be done.
--
Tim Slattery
MS MVP(DTS)
Slattery_T@bls.gov |
|
|
| Back to top |
|
 |
|
|
|
|