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

Create your own file type

daniel aristidou
100+
P: 491
hi guys...i want to make files that can be opened only by my application.
ie a file type unique to my application, does anyone know how to do this?
Jun 14 '08 #1
Share this Question
Share on Google+
7 Replies


P: 66
Check this
http://www.daniweb.com/forums/thread79688.html
Jun 16 '08 #2

daniel aristidou
100+
P: 491
Check this
http://www.daniweb.com/forums/thread79688.html
hi this is a very useful thread, however, it does not tell me how to save data to my custom file
Jun 18 '08 #3

kadghar
Expert 100+
P: 1,295
your 'own file type' can be a plain text file, where the info is stored in an specific way

lets say your program writes text with some format, then you can asign the first line to format, and from the second line on, the text the user wrote. So a saved file will be something like:

Expand|Select|Wrap|Line Numbers
  1. arial 12 bold
  2. dear mr.
  3. this is a sample letter...
you can save it with any extension you want, and there you go, you have your own file type.

if you want to be more sofisticated, use or create a ripper. If you like numbers and that stuff, you'll find very amusing creating your own (geek ^.^).

HTH
Jun 18 '08 #4

daniel aristidou
100+
P: 491
your 'own file type' can be a plain text file, where the info is stored in an specific way

lets say your program writes text with some format, then you can asign the first line to format, and from the second line on, the text the user wrote. So a saved file will be something like:

Expand|Select|Wrap|Line Numbers
  1. arial 12 bold
  2. dear mr.
  3. this is a sample letter...
you can save it with any extension you want, and there you go, you have your own file type.

if you want to be more sofisticated, use or create a ripper. If you like numbers and that stuff, you'll find very amusing creating your own (geek ^.^).

HTH
Thanks for the reply, what is a ripper?- sounds like fun

i considered the Txt file way, however i want the information to be inacceasable to other programs.
Jun 18 '08 #5

jeffstl
Expert 100+
P: 432
Thanks for the reply, what is a ripper?- sounds like fun

i considered the Txt file way, however i want the information to be inacceasable to other programs.
If you name the file with your own custom extension, it will be inaccessible to other programs by default. Because the program won't recognize the extension.

A savvy user will obviously be able to get around this but....., if you want even better security then that then you will need to encrypt the data in the file, and have your own alogorithim decrypt the data back to a recognizable format by your program.

Either way, no matter which way you look at thats exactly what a file is. ASCII or binary data. You can't really get around that. If you try hard enough most ANY file can be opened in notepad after all...try it. The only ones that won't be recognizable are binary formats like images, movies, and other media....or files that are encrypted as I described
Jun 18 '08 #6

jeffstl
Expert 100+
P: 432
Just as some examples....try opening the following file types from within notepad

.vbp, .tmp, .dat, etc

You will find that there is data within these files viewable from notepad. The only difference is that if you open .vbp with Visual basic it interprets it differently and uses the data in the file to display your visual basic project.

Many programs use this same kind of style and give the file thier own extension.
Jun 18 '08 #7

kadghar
Expert 100+
P: 1,295
Thanks for the reply, what is a ripper?- sounds like fun

i considered the Txt file way, however i want the information to be inacceasable to other programs.
a ripper is a tool to encript info.

lets do a very simple example
i'll change each letter for the next one in the alphabet, so if you have

Hello

i'll will save in the text file:

Ifmmp

and when it reads it, it'll do de opposite action.

^.^ of course there are many very crazy algorithms to do this (and to undo it).
Jun 18 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.