[R] png overwrites upper/lower case filenames

Timo Becker timo.becker at oeaw.ac.at
Tue Apr 11 11:27:34 CEST 2006


Prof Brian Ripley schrieb:

> *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?).

Got it. I was just perplexed by the retained filenames with the new outputs.
Thanks for your help.
Cheers,
Timo

>
> 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
>>
>>
>


-- 
Timo Becker
Phonetics
Austrian Academy of Sciences
Acoustics Research Institute




More information about the R-help mailing list