By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,572 Members | 2,949 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,572 IT Pros & Developers. It's quick & easy.

creating a file format

P: n/a
Hi all,

As a general question: Is it possible to create custom file formats? I do
not mean changing the attribute of a known file. For ex: A text file
transformed into a .xyz will still be readable...

So What I mean is a file format which will be readed by only one type
application, lets call it YaFR (Yet another File reader).

Thank you for your help!

--
Cengiz Ulku
ce*****@bluewin.ch
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Cengiz Ulku wrote:
Hi all,

As a general question: Is it possible to create custom file formats?
I do not mean changing the attribute of a known file. For ex: A text
file transformed into a .xyz will still be readable...

So What I mean is a file format which will be readed by only one type
application, lets call it YaFR (Yet another File reader).

Sure, you can do pretty much anything you want to. And once you have
your format, you can give it a unique extension (or as unique as
possible, these days) and register it ("Open with...") so your
application is launched when the user double-clicks on a file of that
type. Read the Command$ when your program starts to see what file name
was passed to it.

Unless you use encryption, or other means of obfuscation, there's
nothing to stop someone else from reading the file in another
application, but since you don't say why you want this we can't know if
that would be an issue.
--

Jim Mack
MicroDexterity Inc
www.microdexterity.com
Jul 17 '05 #2

P: n/a
On Thu, 28 Aug 2003 17:41:27 +0200, in comp.lang.basic.visual "Cengiz
Ulku" <ce*****@bluewin.ch> wrote:
| Hi all,
|
| As a general question: Is it possible to create custom file formats? I do
| not mean changing the attribute of a known file. For ex: A text file
| transformed into a .xyz will still be readable...
|
| So What I mean is a file format which will be readed by only one type
| application, lets call it YaFR (Yet another File reader).


If you are designing your own file format then you can do anything
that you like.

The most standard format is: place a character below chr(32) at the
start of the file. Followed by an identifier (jpg/gif/swg/png/pdf etc)
then the file version number, creation date/time. Then have a series
of blocks that will identify your actual data blocks. This would be
the starting location within the file and the size of the block
itself. Within these blocks there might be other references to other
block (linked lists).

Get yourself a hex editor (plenty of freeware/shareware) and examine
some common files like jpg, gif, swf, doc files. You can even look at
pdf files - just right mouse click on a pdf file and select notepad to
view the file (yes it is a plain text file). If you're lucky you might
pick a PDF file that hasn't been encrypted :-)

---------------------------------------------------------------
jn****@yourpantsbigpond.net.au : Remove your pants to reply
---------------------------------------------------------------
Jul 17 '05 #3

P: n/a
Do you know any web sites or any resources for some sample projects for a
practical approach to this question, which -still- is totally strange for
me?

Thanks a lot!

--
Cengiz Ulku
cengizu at bluewin.ch
"Jeff North" <jn****@yourpantsbigpond.net.au> wrote in message
news:93********************************@4ax.com...
On Thu, 28 Aug 2003 17:41:27 +0200, in comp.lang.basic.visual "Cengiz
Ulku" <ce*****@bluewin.ch> wrote:
| Hi all,
|
| As a general question: Is it possible to create custom file formats? I do| not mean changing the attribute of a known file. For ex: A text file
| transformed into a .xyz will still be readable...
|
| So What I mean is a file format which will be readed by only one type
| application, lets call it YaFR (Yet another File reader).


If you are designing your own file format then you can do anything
that you like.

The most standard format is: place a character below chr(32) at the
start of the file. Followed by an identifier (jpg/gif/swg/png/pdf etc)
then the file version number, creation date/time. Then have a series
of blocks that will identify your actual data blocks. This would be
the starting location within the file and the size of the block
itself. Within these blocks there might be other references to other
block (linked lists).

Get yourself a hex editor (plenty of freeware/shareware) and examine
some common files like jpg, gif, swf, doc files. You can even look at
pdf files - just right mouse click on a pdf file and select notepad to
view the file (yes it is a plain text file). If you're lucky you might
pick a PDF file that hasn't been encrypted :-)

---------------------------------------------------------------
jn****@yourpantsbigpond.net.au : Remove your pants to reply
---------------------------------------------------------------

Jul 17 '05 #4

P: n/a
On Fri, 29 Aug 2003 19:26:15 +0200, in comp.lang.basic.visual "Cengiz
Ulku" <ce*****@bluewin.ch> wrote:
| Do you know any web sites or any resources for some sample projects for a
| practical approach to this question, which -still- is totally strange for
| me?
|
| Thanks a lot!


Having a quick look through Google I found these 2 sites that might be
of interest.
http://www20.brinkster.com/draqza/filept2.html

(If you can stand the red text of black background colours). Although
it looks as though this is for C++ language you should be able to
adapt this easily to VB.

http://www.faqs.org/faqs/graphics/fileformats-faq/
A list of sites and other information that you might find useful.
---------------------------------------------------------------
jn****@yourpantsbigpond.net.au : Remove your pants to reply
---------------------------------------------------------------
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.