From: Jeff Caton on
I would like to attach a custom "header" to a file so that I can savely
identify which format is it (it's my own custom format). Can somebody
please tell me how to do that?
I don't want to use the extension only because I have different versions
of my file format and I need to check which one is actually is.

From: Jim Mack on
Jeff Caton wrote:
> I would like to attach a custom "header" to a file so that I can
> savely identify which format is it (it's my own custom format). Can
> somebody please tell me how to do that?
> I don't want to use the extension only because I have different
> versions of my file format and I need to check which one is
> actually is.

If it's your own custom format, then you've defined how it's
constructed and read, so you can do whatever you want. What part is
giving you trouble?

--
Jim Mack
Twisted tees at http://www.cafepress.com/2050inc
"We sew confusion"

From: Helmut Meukel on
"Jeff Caton" <j.caton(a)gmailnotspam.com> schrieb im Newsbeitrag
news:e0Dh3fq6KHA.3656(a)TK2MSFTNGP06.phx.gbl...
>I would like to attach a custom "header" to a file so that I can savely
>identify which format is it (it's my own custom format). Can somebody please
>tell me how to do that?
> I don't want to use the extension only because I have different versions of my
> file format and I need to check which one is actually is.
>



How to do this depends on the way you stored your data in the file.
What type of file is it? Random, sequential, binary?
Is it a simple text file with lines of different length separated by CR+LF?
Or are there records of a UDT stored using random access?

Without knowing more about the stored data types and the code
you use to store and retrieve it, it's hard to advice.

Helmut.

From: Nobody on
"Jeff Caton" <j.caton(a)gmailnotspam.com> wrote in message
news:e0Dh3fq6KHA.3656(a)TK2MSFTNGP06.phx.gbl...
>I would like to attach a custom "header" to a file so that I can savely
>identify which format is it (it's my own custom format). Can somebody
>please tell me how to do that?
> I don't want to use the extension only because I have different versions
> of my file format and I need to check which one is actually is.

Make the first byte or few bytes a version number. This doesn't have to be
the same as your software version. It could be just "1". If you mean to ask
how you could insert a header at the beginning of a file, you could create a
new one then delete the original. Finally, if you don't already know it,
check "Put statement" in MSDN.


From: Larry Serflaten on

"Jeff Caton" <j.caton(a)gmailnotspam.com> wrote
> I would like to attach a custom "header" to a file so that I can savely
> identify which format is it (it's my own custom format). Can somebody
> please tell me how to do that?
> I don't want to use the extension only because I have different versions
> of my file format and I need to check which one is actually is.

You say its your own custom format. That means you've designed what
goes into the file, how it's stored, etc. Just reserve a few bytes at the start
to let you store your version information....

LFS