From ripley at stats.ox.ac.uk  Mon Sep 13 21:03:11 2004
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Mon Sep 13 21:03:16 2004
Subject: [Rd] bitmap() doesn't finish with file in Windows (PR#7224)
In-Reply-To: <20040913184259.F012911128@slim.kubism.ku.dk>
Message-ID: <Pine.LNX.4.44.0409132000470.22859-100000@gannet.stats>

This is deliberate, as processing can take a long time and we don't
want to lock R whilst a printer prints a file for example.

Just insert a sleep(1).

It certainly is not a bug, as no one said you would be able to access a 
file immediately.

On Mon, 13 Sep 2004 t.short@epri-peac.com wrote:

> Full_Name: Tom Short
> Version: 1.9.0
> OS: Win2000 
> Submission from: (NULL) (64.65.255.41)
> 
> 
> POSSIBLE WISHLIST, POSSIBLE BUG:
> 
> The following code works on Debian, but fails on Windows 2000 with 'Error in
> file("test.png", "r") : unable to open connection':
> 
> bitmap("test.png")
> plot(c(1,2,3))
> dev.off()
> x = file("test.png","r")
> 
> The problem is that when bitmap uses ghostscript to convert the PS file to a
> PNG, the postscript drive doesn't wait for ghostscript to finish (under
> Windows). In the Linux version, the postscript driver does wait for the printing
> command to finish. Compare the following lines of devPS.c that actually call the
> "cmd":
> 
> #ifdef Unix
> 	    err = R_system(buff);
> #endif
> #ifdef Win32
> 	    err = runcmd(buff, 0, 0, NULL);
> #endif
> 
> RECOMMENDATION: Change runcmd(buff, 0, 0, NULL) to runcmd(buff, 1, 0, NULL) in
> devPS.c to make the driver wait for the command to finish.
> 
> ______________________________________________
> R-devel@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
> 

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


[Rd] bitmap() doesn't finish with file in Windows (PR#7224)
Prof Brian Ripley