Article View: borland.public.cppbuilder.nativeapi
Article #17035Re: Split file.
From: Safari
Date: Thu, 10 Apr 2003 11:24
Date: Thu, 10 Apr 2003 11:24
40 lines
2199 bytes
2199 bytes
Very tanaks Remy,
I used your source and worked fine.
1. How can i choose size file with your source now?
2. My source return me: Stream read error! why?
void __fastcall TMain::BitBtn1Click(TObject *Sender)
{
BYTE hBuf;
int hBin = 0;
int hExt = 0;
int hLen = Edit3->Text.ToInt();
if (FileExists(Edit1->Text))
{
TFileStream *hSource = new TFileStream(Edit1->Text, fmOpenRead |
fmShareDenyWrite);
Progress->Max = hSource->Size;
for (int a = 0; a < hSource->Size; a++)
{
hExt++;
AnsiString hName = Format("%s.%.3d",
ARRAYOFCONST((Edit2->Text, hExt));
hExt));
TFileStream *hTarget = new TFileStream(hName, fmCreate);
do
{
hBin++;
hSource->ReadBuffer (&hBuf, 1);
hTarget->WriteBuffer(&hBuf, 1);
Progress->Position = hSource->Position;
}
while (hBin != hLen);
delete hTarget;
}
delete hSource;
Progress->Position = 0;
}
}
Thanks again,
Safari
Technical Details
Message-ID:
<3E955473.6000807@alloymail.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!news.maxwell.syr.edu!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3E8F1D05.40008@alloymail.com> <3e8f69e0@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,8f5102c5a422c5bb X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-04-10 17:03:08 PST Message-ID: <3E955473.6000807@alloymail.com> Date: Thu, 10 Apr 2003 15:54:35 +0430 From: Safari <Safari@alloymail.com> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Split file. References: <3E8F1D05.40008@alloymail.com> <3e8f69e0@newsgroups.borland.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 81.28.33.78 X-Trace: newsgroups.borland.com 1050019252 81.28.33.78 (10 Apr 2003 17:00:52 -0700) Lines: 41 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!news.maxwell.syr.edu!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail