Re: [R] Image from bytes streams

From: Earl F. Glynn <>
Date: Wed 17 Aug 2005 - 05:34:15 EST

"Márcio de Medeiros Ribeiro" <> wrote in message news:<>...
>My big problem is that my program reads the image before that its
>complete by the png() function. For instance, my graphic image has
>1000Kb. When R saves it into the hard disk, my Java program reads the
>file before the save operation completes (500Kb for example). So, I
>got only a part of the file and hence the image... :(
>One solution is read the image and search for a byte which represents
>the end of the file, but it depends on the image format...

Have you considered in R writing the file to a temporary name (see ?tempfile). When the file is complete, after the in R as suggested by Prof Ripley, you could rename the file [using in R]. Your external program can now access the file without worrying about whether it is complete, since the file appears not to exist until the whole file has been written.

efg mailing list PLEASE do read the posting guide! Received on Wed Aug 17 05:48:15 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 15:24:22 EST