• C

File Headers

Hi, i'm trying to write a program to handle some file headers (EXE, COM, TXT, GIF, JPG, BMP), but i can't find information about the header structure of these format, specially i want to get the date, the name, the size and the type of the file (getting all from its header). I'll appreciate your help about anyone of the headers. And i'm sorry for my english :P i hope it be understable.
WeiMxAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

KocilCommented:
I think you do not need to read the header to get those information. In fact, those information are NOT in the header.
  - date, some header contains it, but not all.
  - name, never in the header.
  - size, maybe in the header, but usually only data size.
  - type. Yes it's always in the header, but 99% the file
    extension is right.

So why don't you use the simple findfirst command ?.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nabeenCommented:
hi there,
          use findfirst and findnext function to find the required file and u can then find the size,name, etc by using ffblk.ff_name,ffblk.ff_fsize, see the required header file for that.
bye
0
nabeenCommented:
search for ffblk command in header file there u will find all the required information that u can access about the file.
0
Choose an Exciting Career in Cybersecurity

Help prevent cyber-threats and provide solutions to safeguard our global digital economy. Earn your MS in Cybersecurity. WGU’s MSCSIA degree program was designed in collaboration with national intelligence organizations and IT industry leaders.

cybeonixCommented:
Tons of file information on some websites. One of my favorites http://www.wotsit.org/
0
gotenksCommented:
check out this page if you are not sure of how to use the _findfirst and _findnext function suggested by kocil and nabeen.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_crt__findnext.2c_._findnexti64.2c_._wfindnext.2c_._wfindnexti64.asp

hope this will help.
0
jmcgOwnerCommented:
Nothing has happened on this question in over 10 months. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
split points between Kocil and nabeen.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.