"Márcio de Medeiros Ribeiro" <[EMAIL PROTECTED]> wrote in message
news:<[EMAIL PROTECTED]>...
>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 dev.off() in R as suggested
by Prof Ripley, you could rename the file [using file.name() 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

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to