creating a file format

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cengiz Ulku

    creating a file format

    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
    cengizu@bluewin .ch


  • Jim Mack

    #2
    Re: creating a file format

    Cengiz Ulku wrote:[color=blue]
    > 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).[/color]


    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



    Comment

    • Jeff North

      #3
      Re: creating a file format

      On Thu, 28 Aug 2003 17:41:27 +0200, in comp.lang.basic .visual "Cengiz
      Ulku" <cengizu@bluewi n.ch> wrote:
      [color=blue]
      >| 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).[/color]

      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 :-)

      ---------------------------------------------------------------
      jnorth@yourpant sbigpond.net.au : Remove your pants to reply
      ---------------------------------------------------------------

      Comment

      • Cengiz Ulku

        #4
        Re: creating a file format

        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" <jnorth@yourpan tsbigpond.net.a u> wrote in message
        news:93cskv8u10 o65g9mpjc3ub916 e16t7rs74@4ax.c om...[color=blue]
        > On Thu, 28 Aug 2003 17:41:27 +0200, in comp.lang.basic .visual "Cengiz
        > Ulku" <cengizu@bluewi n.ch> wrote:
        >[color=green]
        > >| Hi all,
        > >|
        > >| As a general question: Is it possible to create custom file formats? I[/color][/color]
        do[color=blue][color=green]
        > >| 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).[/color]
        >
        > 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 :-)
        >
        > ---------------------------------------------------------------
        > jnorth@yourpant sbigpond.net.au : Remove your pants to reply
        > ---------------------------------------------------------------[/color]


        Comment

        • Jeff North

          #5
          Re: creating a file format

          On Fri, 29 Aug 2003 19:26:15 +0200, in comp.lang.basic .visual "Cengiz
          Ulku" <cengizu@bluewi n.ch> wrote:
          [color=blue]
          >| 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![/color]

          Having a quick look through Google I found these 2 sites that might be
          of interest.


          (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.


          A list of sites and other information that you might find useful.
          ---------------------------------------------------------------
          jnorth@yourpant sbigpond.net.au : Remove your pants to reply
          ---------------------------------------------------------------

          Comment

          Working...