Erik Blankinship | 5 Oct 01:44
Favicon
Gravatar

Re: files over tubes


Erik Blankinship wrote:
> It is not clear to me how I would send a large pdf file using tubes.

How large? Large enough that you wouldn't want to store the whole thing in memory?

Yes.
 


_______________________________________________
Sugar mailing list
Sugar <at> lists.laptop.org
http://lists.laptop.org/listinfo/sugar
Morgan Collett | 8 Oct 16:06
Picon

Re: files over tubes

Erik Blankinship wrote:
> 
>     Erik Blankinship wrote:
>     > It is not clear to me how I would send a large pdf file using tubes.
> 
>     How large? Large enough that you wouldn't want to store the whole
>     thing in memory?
> 
> 
> Yes.

I attached an (untested, incomplete) patch for HelloMesh to
https://dev.laptop.org/ticket/4051 as a suggestion.

Let me know if you get stuck.

Regards
Morgan
Favicon

Re: files over tubes

Thank you for the code!
I could use that methods with success in Memorize,  was just needed some specific changes.

Maybe there is a isolated problem in number chunks value, which should be round up in order to send the entire file.

Concerning about chunk size,  I tested with success the value 4096. That speed up the transfer time.
There is a best value for chunk size?

On 10/8/07, Morgan Collett <morgan.collett <at> collabora.co.uk> wrote:
Erik Blankinship wrote:
>
>     Erik Blankinship wrote:
>     > It is not clear to me how I would send a large pdf file using tubes.
>
>     How large? Large enough that you wouldn't want to store the whole
>     thing in memory?
>
>
> Yes.

I attached an (untested, incomplete) patch for HelloMesh to
https://dev.laptop.org/ticket/4051 as a suggestion.

Let me know if you get stuck.

Regards
Morgan
_______________________________________________
Sugar mailing list
Sugar <at> lists.laptop.org
http://lists.laptop.org/listinfo/sugar



--
Muriel de Souza Godoi
muriel <at> laptop.org
Intern Developer
One Laptop Per Child
_______________________________________________
Sugar mailing list
Sugar <at> lists.laptop.org
http://lists.laptop.org/listinfo/sugar
Morgan Collett | 12 Oct 11:12
Picon

Re: files over tubes

Muriel de Souza Godoi wrote:
> Thank you for the code!
> I could use that methods with success in Memorize,  was just needed some
> specific changes.
> 
> Maybe there is a isolated problem in number chunks value, which should
> be round up in order to send the entire file.

Yes, could be, I didn't test it completely.

> Concerning about chunk size,  I tested with success the value 4096. That
> speed up the transfer time.
> There is a best value for chunk size?

Erik wanted to transfer files that wouldn't necessarily fit in memory.
If you are working with files that do fit in memory while running the
activity, you can take out the chunk logic and just read in the whole
file and send it in one go.

Otherwise, you could experiment with larger chunks and see what works.
Try both server (gabble) and link local (salut) sharing, they should
both support message fragmentation allowing large messages but they may
have different limits at the moment.

Regards
Morgan
Erik Blankinship | 12 Oct 15:11
Favicon
Gravatar

Re: files over tubes


> Maybe there is a isolated problem in number chunks value, which should
> be round up in order to send the entire file.

Yes, could be, I didn't test it completely.


"""Send a file over the D-Bus Tube"""
size = os.path.getsize(filename)
f = open(filename)
chunk_size = 1000
chunks = size / chunk_size
if (size%chunk_size != 0):
     chunks += 1
 

_______________________________________________
Sugar mailing list
Sugar <at> lists.laptop.org
http://lists.laptop.org/listinfo/sugar
Erik Blankinship | 12 Oct 15:11
Favicon
Gravatar

[sugar] files over tubes

> > Maybe there is a isolated problem in number chunks value, which should
> > be round up in order to send the entire file.
>
> Yes, could be, I didn't test it completely.

"""Send a file over the D-Bus Tube"""
size = os.path.getsize(filename)
f = open(filename)
chunk_size = 1000
chunks = size / chunk_size
if (size%chunk_size != 0):
     chunks += 1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.laptop.org/pipermail/sugar/attachments/20071012/427ec5a7/attachment.htm 

Morgan Collett | 12 Oct 11:12
Picon

[sugar] files over tubes

Muriel de Souza Godoi wrote:
> Thank you for the code!
> I could use that methods with success in Memorize,  was just needed some
> specific changes.
> 
> Maybe there is a isolated problem in number chunks value, which should
> be round up in order to send the entire file.

Yes, could be, I didn't test it completely.

> Concerning about chunk size,  I tested with success the value 4096. That
> speed up the transfer time.
> There is a best value for chunk size?

Erik wanted to transfer files that wouldn't necessarily fit in memory.
If you are working with files that do fit in memory while running the
activity, you can take out the chunk logic and just read in the whole
file and send it in one go.

Otherwise, you could experiment with larger chunks and see what works.
Try both server (gabble) and link local (salut) sharing, they should
both support message fragmentation allowing large messages but they may
have different limits at the moment.

Regards
Morgan

Favicon

[sugar] files over tubes

Thank you for the code!
I could use that methods with success in Memorize,  was just needed some
specific changes.

Maybe there is a isolated problem in number chunks value, which should be
round up in order to send the entire file.

Concerning about chunk size,  I tested with success the value 4096. That
speed up the transfer time.
There is a best value for chunk size?

On 10/8/07, Morgan Collett <morgan.collett at collabora.co.uk> wrote:
>
> Erik Blankinship wrote:
> >
> >     Erik Blankinship wrote:
> >     > It is not clear to me how I would send a large pdf file using
> tubes.
> >
> >     How large? Large enough that you wouldn't want to store the whole
> >     thing in memory?
> >
> >
> > Yes.
>
> I attached an (untested, incomplete) patch for HelloMesh to
> https://dev.laptop.org/ticket/4051 as a suggestion.
>
> Let me know if you get stuck.
>
> Regards
> Morgan
> _______________________________________________
> Sugar mailing list
> Sugar at lists.laptop.org
> http://lists.laptop.org/listinfo/sugar
>

--

-- 
Muriel de Souza Godoi
muriel at laptop.org
Intern Developer
One Laptop Per Child
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.laptop.org/pipermail/sugar/attachments/20071012/988428ce/attachment.htm 

Morgan Collett | 8 Oct 16:06
Picon

[sugar] files over tubes

Erik Blankinship wrote:
> 
>     Erik Blankinship wrote:
>     > It is not clear to me how I would send a large pdf file using tubes.
> 
>     How large? Large enough that you wouldn't want to store the whole
>     thing in memory?
> 
> 
> Yes.

I attached an (untested, incomplete) patch for HelloMesh to
https://dev.laptop.org/ticket/4051 as a suggestion.

Let me know if you get stuck.

Regards
Morgan


Gmane