Forum > General

SOLVED Pack Files into one and extract

(1/2) > >>

DreamVB:
Hi, Can someone help me please I am looking for a way to pack a list of files into one file, so that I can extract them. I am trying to make my own little setup program, I don't need compression just something to put the files into one, something like the PAK format. I remember years ago I had a class to work with PAK files on a Delphi cd but I lost it. I tried looking on google and can't seem to find anything, if you can help I be very happy thanks.

wp:
Although you do not request compression, I'd use the zipper unit nevertheless: https://wiki.freepascal.org/paszlib#Examples

DreamVB:
Can someone have a look at my project please I sort of got something packing the files into a bag file but I am having problems extract it only seems to extract one file. I added the project with this post

Thanks

Thaddy:
The usual case of case?

Roland57:
Hello! I think the current code doesn't read the right number of bytes for each file. I would try something like this.


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---    while fileheader.fSize > sizeof(TBuffer) do    begin      blockread(BagFile, TBuffer, sizeof(TBuffer), bRead);      blockwrite(outfile, TBuffer, bRead, bWrote);      Dec(fileheader.fSize, sizeof(TBuffer));    end;    blockread(BagFile, TBuffer, fileheader.fSize, bRead);    blockwrite(outfile, TBuffer, bRead, bWrote);
Here, it seems to work.

P.-S. I removed this line:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---Seek(BagFile, filepos(BagFile) + FileHeader.fSize);

Navigation

[0] Message Index

[#] Next page

Go to full version