Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

A question about storing files in applications

What's the simpliest most efficient way to store a file in an application? Is it in a blob or what?

And how do I get this file out as a constant if necesery?

Comments

  • zibadianzibadian Posts: 6,349Member
    : What's the simpliest most efficient way to store a file in an application? Is it in a blob or what?
    :
    : And how do I get this file out as a constant if necesery?
    :
    I usually append the file at the end of the executable itself. This way it becomes a kind of resource. Then you can read the executable from the final byte of the compiled executable to the end of the file.
  • jobromediajobromedia Posts: 168Member
    : : What's the simpliest most efficient way to store a file in an application? Is it in a blob or what?
    : :
    : : And how do I get this file out as a constant if necesery?
    : :
    : I usually append the file at the end of the executable itself. This way it becomes a kind of resource. Then you can read the executable from the final byte of the compiled executable to the end of the file.
    :
    How do I do that?
  • zibadianzibadian Posts: 6,349Member
    : : : What's the simpliest most efficient way to store a file in an application? Is it in a blob or what?
    : : :
    : : : And how do I get this file out as a constant if necesery?
    : : :
    : : I usually append the file at the end of the executable itself. This way it becomes a kind of resource. Then you can read the executable from the final byte of the compiled executable to the end of the file.
    : :
    : How do I do that?
    :
    Open the executable using a TFileStream. Seek the end of the file, and write the data-file to that stream. The best way is to use some recognizable prefix to separate the executable from the data-file.
    When the executable runs, open itself as a data file, then find that prefix and read the data-file.
Sign In or Register to comment.