[R] png overwrites upper/lower case filenames

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Apr 11 11:04:14 CEST 2006


*on Windows*

This is how the Windows file system works.  You cannot have a.png and 
A.png in a directory on a Windows file system.  If you unlink() the file
with the clashing name it will create it with the case you want (but since 
asking Windows for "B.png" will give you "b.png", does it matter?).

On Tue, 11 Apr 2006, Timo Becker wrote:

> Dear R users,
>
> when I create files with the png graphics device, it overwrites existing
> files which differ concerning upper/lower case file names.
> For example, I want to create four files named "a.png", "A.png", "b.png"
> and "B.png" which contain the corresponding letters:
>
> png("a.png")
> plot(1, type="n")
> text(1, label="a")
> dev.off()
>
> png("A.png")
> plot(1, type="n")
> text(1, label="A")
> dev.off()
>
> png("B.png")
> plot(1, type="n")
> text(1, label="B")
> dev.off()
>
> png("b.png")
> plot(1, type="n")
> text(1, label="b")
> dev.off()
>
> These commands create a file named "a.png" which contains the letter "A"
> and a file named "B.png" which contains the letter "b".
> The old file name is retained, but overwritten with the output of the
> new png device with the same case-insensitive file name.
> I'm sure I missed something. Can anyone tell me how to create files
> whith case-sensitive names with the same letters?
>
> R version 2.2.1, 2005-12-20, i386-pc-mingw32
>
> Regards,
> Timo
>
>

-- 
Brian D. Ripley,                  ripley at 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




More information about the R-help mailing list