[R] Problem with pdf, png, jpeg devices and files named CON on Window s

From: Brandt, T. (Tobias) <TobiasBr_at_Taquanta.com>
Date: Mon 15 Jan 2007 - 10:05:15 GMT


I cannot seem to create any files that have the name "CON" before the file extension, i.e. all of the following fail:  

> pdf("CON.pdf")

Error in pdf("CON.pdf") : unable to start device pdf
> jpeg('CON.jpeg')

Error in jpeg("CON.jpeg") : unable to start device devWindows
> png('CON.png')

Error in png("CON.png") : unable to start device devWindows
> sink('CON.txt')

Error in file(file, ifelse(append, "a", "w")) :

        unable to open connection

Any filename other than this works fine.  

> png('ICON.png')
> dev.off()

null device

> png('CON1.png')
> dev.off()

null device

> sink('log.txt')
> sink()

Remembering that in the old DOS days, commands like 'copy CON myfile.bat' were common, I suspected that this has something to do with CON being a reserved word so I tried to create the files manually in Windows explorer. Creating files named 'CON.png', 'CON.pdf', 'CON.txt' all work fine. However I did notice that Windows won't let me create a file named just "CON". However since the devices that I'm trying to create have extensions, I don't understand why they fail.  

Who can help?  


> version

platform       i386-pc-mingw32           
arch           i386                      
os             mingw32                   
system         i386, mingw32             
major          2                         
minor          3.1                       
year           2006                      
month          06                        
day            01                        
svn rev        38247                     
language       R                         
version.string Version 2.3.1 (2006-06-01)

> Sys.info()

                      sysname                       release
version                      nodename 
                    "Windows"                      "NT 5.1" "(build 2600)
Service Pack 2"            
                      machine                         login


Nedbank Limited Reg No 1951/000009/06. The following link displays the names of the Nedbank Board of Directors and Company Secretary. [ http://www.nedbank.co.za/terms/DirectorsNedbank.htm ] This email is confidential and is intended for the addressee only. The following link will take you to Nedbank's legal notice. [ http://www.nedbank.co.za/terms/EmailDisclaimer.htm ]

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 and provide commented, minimal, self-contained, reproducible code. Received on Mon Jan 15 21:21:02 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 15 Jan 2007 - 14:30:30 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.