|
#1
|
|||
|
|||
|
how to store data in a folder
hi..i am writng a program.....i have collected a lot of information(name,hobbies etc.....) of about a hundred students in my school.......i have also stored their photographs in .jpeg format.........i am using Dev c++ and windows xp..........i want to store all this info + photos in a single file....how do i go about it............i started programmin a few days ago......so whatever u explain...please explain it in lay mans terms..........i dont want the entire code....but parts of the code ....it wud be great if you could explain it a bit n could give sources for me study it in greater detail
|
|
#2
|
|||
|
|||
|
You can store many files into a single one, but the result cannot be used by anything except your program (to put them back to normal) -- the pictures cannot be seen, etc, because the file format is now way different that the standard jpeg format.
To do this, you simply open your current existing file, write the whole thing to a new file, insert some sort of "break" delimiter or start with the number of bytes or something like this to tell where one file stops and another starts. THen open the next file, and write it. Over and over, open a file, read it, write it all into your blob-file. One easy way to do this job is to use the free zip library to zip up all the files (zlib is its name) into a single file, this does all the work for you and the final file saves space too. Now you mentioned folders in the topic, but not in your question. Did you mean, instead, "how do I copy the related files into a single folder" ?? If this is the case, there are several ways. You can open the existing file, open a file to write to, read the input and write the output, pretty much a done deal. You can also be lazy, and use operating system commands to do this inside your c++ code, the same way you would do it by typing commands in a command window. Clarify what you really want to do here (the top or bottom option, or something else?) and I can toss some example code at you. And please, use english this time. Its... annoying ... to read ... something.... like.... this!!! |
|
#3
|
||||
|
||||
|
I Agree!
__________________
Danny Kalev |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Store data in to the XML file | mndprasad | XML | 1 | 07-11-2008 02:00 PM |
| Data Service 2.0.0 | zw_sea | Java | 0 | 05-28-2007 02:23 AM |
| MS Access - How to store various data types in the same field. | Ron Weller | Database | 2 | 05-12-2007 05:11 PM |
| Why I can't save data in data base? | Kurt | Java | 7 | 10-08-2006 09:59 AM |
| How to use SQL Server Text data type to store html documents | Neen Help | VB Classic | 1 | 01-22-2001 02:57 PM |