Boost logo

Boost :

From: Adrovic, Ervin (ervin.adrovic_at_[hidden])
Date: 2008-05-21 02:15:40


Thanks Matus,

Do you have any sample how to copy list of files using boost.asio?
It is not just to stream binary data of file I need to send some meta data (filenames, ...) for multiple files.
Is there any standard way doing that?

Thanks
Ervin

-----Original Message-----
From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]] On Behalf Of Matus Chochlik
Sent: Tuesday, May 20, 2008 16:11
To: boost_at_[hidden]
Subject: Re: [boost] MPI and file copy

Hi,

On Tue, May 20, 2008 at 2:04 PM, Adrovic, Ervin <ervin.adrovic_at_[hidden]> wrote:
> Hi,
>
> I would like to copy binary files from host A to host B. That for I was thinking to use boost MPI and open file on one side read buffer and send it to other side.

If You just want to copy files then using MPI is IMHO an overkill.
Boost.Asio is probably a better choice.

>
> bool SendFile(std::ifstream* inputFile) {
> bool ret = true;
> if (inputFile != NULL)
> {
> CData data;
> while (inputFile->eof() == false)
> {
> inputFile->read(data.GetDataBuffer(), data.GetDataBufferSize());
> std::streamsize nRead = inputFile->gcount ();
> data.SetDataLen(nRead);
> GetWorld().send(1, MSG_CDATA, data);
> }
> inputFile->close();
> }
>
> return ret;
> }
>
> To complicate a litle bit I may use filters (ZIP, Encrypt, ...) for this operation.
>
> Any idea/sample hoe to implement that?
> Is it possibale to do steaming using MPI?
>
> Thanks
> Ervin
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>

--
________________
::matus_chochlik
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk