Article View: borland.public.cppbuilder.nativeapi
Article #17037Re: Split file.
From: Remy Lebeau (TeamB)
Date: Fri, 11 Apr 2003 01:27
Date: Fri, 11 Apr 2003 01:27
42 lines
2539 bytes
2539 bytes
"Safari" <Safari@alloymail.com> wrote in message
news:3E955473.6000807@alloymail.com...
> I used your source
No, you're not. I've posted my code twice for you now, but your code, as
you've posted it here, still does not resemble my code at all. You're off
doing your own things. My code does not use TFileStream and sets aside a
fixed-sized buffer and then read/wrote the files in full 50000b blocks at a
time. Your code, on the other hand, is using TFileStream and is
reading/writing the files one byte at a time instead.
> 1. How can i choose size file with your source now?
Your code, as you've posted it here, is already taking that into account.
Although, your outer for() loop is very very wrong, you're not managing the
loop counter correctly at all. If you're going to continuing using your own
code instead of mine, then you need to use a while() loop instead of a for()
loop, ie:
void __fastcall TMain::BitBtn1Click(TObject *Sender)
{
...
// this loop is wrong!
// for (int a = 0; a < hSource->Size; a++)
while( hSource->Position < hSource->Size )
{
...
}
}
> 2. My source return me: Stream read error! why?
If you had actually read my other replies, I've already explained to you
exactly why that is occuring. Do not call ReadBuffer() and WriteBuffer(),
use Read() and Write() instead. You're getting an exception because you are
using methods that are specifically designed to throw an exception.
Gambit
Technical Details
Message-ID:
<3e9619fe$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3E8F1D05.40008@alloymail.com> <3e8f69e0@newsgroups.borland.com> <3E955473.6000807@alloymail.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 18:34:05 PST From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3E8F1D05.40008@alloymail.com> <3e8f69e0@newsgroups.borland.com> <3E955473.6000807@alloymail.com> Subject: Re: Split file. Date: Thu, 10 Apr 2003 18:27:49 -0700 Lines: 44 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 207.175.226.26 Message-ID: <3e9619fe$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1050024446 207.175.226.26 (10 Apr 2003 18:27:26 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail