Solved

Streams

Posted on 1998-06-16
7
131 Views
Last Modified: 2010-04-04
I know the TSaveToStream etc. but i cant get the stuff working as i want..

in need a Sample of where you like select files and Add the to a Data File, and how to get in contact with them,
like putting 10 exe files in a dat file, and be able to run the apps..
0
Comment
Question by:brainware
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 1

Expert Comment

by:michaue
Comment Utility
Let me see if I understand you correctly.

You want

1.  the user to be able to select files and then your program must write the locations of the files into a data file
2.  the program to read this data file at a later stage and display it as a pick list to the user.
3.  the user to pick one of the listed files and then run it from within your program

???


0
 
LVL 2

Author Comment

by:brainware
Comment Utility
I want to copy the files into a DATA file, like a WAD file..
and be able to use the files in hmm WAD file,
like this:  make a WAD!!! file with 10 jpeg or bmp pics, and be able to get info from the
wad file of whats in it, and be able to view the pics..

dont have to be pics... but somthing not only text.

hope u can do it.. now im being nice.. +pts
0
 
LVL 1

Expert Comment

by:michaue
Comment Utility
Nope, you've lost me ...

Hope you find an answer ... you should, this is a pretty good site

Have Fun

Elfrieda :)
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 1

Expert Comment

by:Socrates050697
Comment Utility
I thik this is what you need :-

1. Create a new TFilestream

2. Add a header to it showing what files are going to be stored in the DAT file. (I've done this before by creating a new component - THeader, which has some string properties. Being a component you can just stream it out into the TFilestream)

3. Load the Bitmaps (or whatever) using a TMemorystream object.
4. Stream the TMemorystream to the TFilestream
5. Repeat steps 3 and 4 for each file.

To then extract the files, you have to read the header and then read each of the files and save the one you want as a file on its own. It can then be used as normal.


Socrates.
0
 
LVL 5

Accepted Solution

by:
ronit051397 earned 190 total points
Comment Utility
This is something I found somewhere, Hope this helps:

14. Appending Files

Q:
Does anyone have a procedure/advice/whatever for adding several files
onto one file, then separating them back into the original files /w
filenames, properties, and everything? I was thinking of using the
Append() procedure, but that's for text files, and I'm working with
binary files (compressed, encrypted, what have you).

A:
What I would do is this:

First I create a TFileStream.

Then Write to it a blank but a fixed length header block .

This header block can contain anything you want to keep in
there; such as starting pos of each 'file', their lenths,
file names, copyright info etc.

Initially you can just write a blank header block to act
as place holder (you'll fill it up later)

Then create as many TMemoryStream as you have files/data/whatever.

Then using MyMemoryStream.SaveToStream(MyFileStream) write every
one of those MemoryStreams into the FileStream. Making a note of
MyFileStream.Posotion and MyMemoryStream.Size.

Havin filled your MyFileStream with data, you can now set

FileStream,Position := 0
and fill up the header block you had rserved in the first step.

Retrieving each data block is simply a reverse of this.

[kanca@ibm.net]
0
 
LVL 5

Expert Comment

by:ronit051397
Comment Utility
0
 
LVL 2

Author Comment

by:brainware
Comment Utility
k.. ill just have to get the rest working from there..

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now