🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.delphi.nativeapi
Article #12076

Re: Bakup/Restore My own API, how to...

#12076
From: Johnnie
Date: Mon, 25 Nov 2002 12:03
46 lines
2820 bytes
> E-mail it direct.  

Done you must have in a couple of minutes.

>I've started on a new routine, which writes the header
> and file records, which have had an update all Array of Chars are now
> LPWSTR.  
Since this is a dynamic string variable it is not recommended to be used
in a static Record and we need the record to be static in size so it will
easier to handle. 

Take a look on the example I have send you via email.

>The Files are loaded into a TMemoryStream, compressed and then
> written in teh TFileStream.

> But the FileStream only writes 4 Characters.  If using the
> TMemoryStream.SaveToFile routine then the file is written correctly!!
> 
> 
> Any Ideas?
> 

How do you write it to the file??

I personaly use the TfileStream.CopyFrom(Tmemorystream,0); 

which copys the entire TMemoryStream to the current TfileStream position.
You will find an example on the demo I've send you.

If you do have any questions do not hesitate to ask me.
Please keep in mind that the demo is not complete although
it does creates a list of files in a single file it 
lacks the following abilities

1) I do not seperate the compressed data from each other
   with a start/end tag (required if you want to be able
   to extract uncorrupted files from a corrupted backup file
   easelly).
2) No compression method has been used just a copy of the 
   existing files in a single file.
3) I have removed the fullfilename field as it is not needed
   it can be reconstructed by the FileDir+Filename fields.

Regards
johnnie.
Technical Details
Message-ID: <3de2117a$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-01!sn-xit-08!supernews.com!nntp2.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeed1.cidera.com!Cidera!news.uni-x.net!newsgroups.borland.com!not-for-mail
References: <3dd9162d@newsgroups.borland.com> <3dd94734$1@newsgroups.borland.com> <3dd9f0c3@newsgroups.borland.com> <3dda9fb3@newsgroups.borland.com> <3ddb406c@newsgroups.borland.com> <3ddbb190$1@newsgroups.borland.com> <3ddbb904@newsgroups.borland.com> <3ddca378$1@newsgroups.borland.com> <3ddcbf0c$1@newsgroups.borland.com> <3dddfba2@newsgroups.borland.com> <3dddfd4b@newsgroups.borland.com> <3de1f409@newsgroups.borland.com> <3de20c6e$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f94dd,d8e24b1ddb3db1be
X-Google-Attributes: gidf94dd,public
X-Google-ArrivalTime: 2002-11-25 04:15:41 PST
Newsgroups: borland.public.delphi.nativeapi
Subject: Re: Bakup/Restore My own API, how to...
From: Johnnie <None@Noware.non>
References: <3dd9162d@newsgroups.borland.com> <3dd94734$1@newsgroups.borland.com> <3dd9f0c3@newsgroups.borland.com> <3dda9fb3@newsgroups.borland.com> <3ddb406c@newsgroups.borland.com> <3ddbb190$1@newsgroups.borland.com> <3ddbb904@newsgroups.borland.com> <3ddca378$1@newsgroups.borland.com> <3ddcbf0c$1@newsgroups.borland.com> <3dddfba2@newsgroups.borland.com> <3dddfd4b@newsgroups.borland.com> <3de1f409@newsgroups.borland.com> <3de20c6e$1@newsgroups.borland.com>
User-Agent: Xnews/L5
NNTP-Posting-Host: 195.167.69.130
Message-ID: <3de2117a$1@newsgroups.borland.com>
Date: 25 Nov 2002 04:03:06 -0800
X-Trace: newsgroups.borland.com 1038225786 195.167.69.130 (25 Nov 2002 04:03:06 -0800)
Lines: 47
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-01!sn-xit-08!supernews.com!nntp2.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeed1.cidera.com!Cidera!news.uni-x.net!newsgroups.borland.com!not-for-mail