Where's my bitmap filename?

Just starting out? Need help? Post your questions and find answers here.
abarkley
User
User
Posts: 10
Joined: Sun Jun 07, 2009 7:44 pm
Location: London, UK

Where's my bitmap filename?

Post by abarkley »

Sorry to keep going on about .bmp files.

I want to read/analyse the header of a .bmp file on disk and do some stuff based on the analysis result.

I found this link helpful:

http://www.fortunecity.com/skyscraper/w ... ffrmt.html


But where's the filename? It must be embedded in the file somewhere otherwise how could you copy a single file (say, on a USB stick) to another machine? Isn't it?
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

:roll:
abarkley
User
User
Posts: 10
Joined: Sun Jun 07, 2009 7:44 pm
Location: London, UK

Post by abarkley »

That doesn't really get me any further.

Are you saying that that the characters of a filename are NOT contained within a file? It's not an unreasonable suggestion - other operating systems do it. I seem to remember name data in MS-DOS files.

If it's not, where is it? Going back to my USB stick example, obviously that's got a file structure...a FAT or whatever it's become since I last tried programming. Is that the only place the characters of the filename occur?
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

your link is not usable, fifo reports an attack.

better use wiki: http://en.wikipedia.org/wiki/BMP_file_format

as you can see, the name isn't stored within the file itself.

... anyways, I never heard of such a practice.
the filename is just part of an entry in the FAT, even NTFS handles it that way, I think.
oh... and have a nice day.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

abarkley wrote:Are you saying that that the characters of a filename are NOT contained within a file?
Correct. They are not.
It's not an unreasonable suggestion
It's an extremely unreasonable idea, since it would mean all operating systems must know absolutely all file formats just to store the files.
- other operating systems do it.
No they don't. Windows doesn't do it. DOS doesn't do it. Linux doesn't do it. FreeBSD/OpenBSD/NetBSD/DragonflyBSD doesn't do it. Atari TOS didn't do it. MacOS <=9 didn't do it. OS X doesn't do it. It is just impractical to do it, so no one does it.
I seem to remember name data in MS-DOS files.
It is impossible that this name was a filename. The file can't know when it's moved. After moving the file the file would still contain the old filename. Word's files can also have a title attribute, but it's not the filename.
If it's not, where is it? Going back to my USB stick example, obviously that's got a file structure...a FAT or whatever it's become since I last tried programming. Is that the only place the characters of the filename occur?
The only place file names occur is in the filesystem.

Sorry to be rude, but this is something I think you should know before learning programming.
Post Reply