[Rd] savePlot() no longer automatically adds an extension to the filename.

Duncan Murdoch murdoch at stats.uwo.ca
Wed Jun 4 02:40:03 CEST 2008


On 03/06/2008 2:35 PM, Mike Prager wrote:
> "S Ellison" <S.Ellison at lgc.co.uk> wrote:
> 
>> Plaintive squeak: Why the change? 
>>
>> Some OS's and desktops use the extension, so forgetting it causes
>> trouble. The new default filename keeps a filetype (as before) but the
>> user now has to type a filetype twice (once as the type, once as
>> extension) to get the same effect fo rtheir own filenames. And the
>> extension isn't then checked for consistency with valid file types, so
>> it can be mistyped and saved with no warning. Hard to see the advantage
>> of doing away with it...
> 
> Just for the record. . .
> 
> This change broke a *lot* of my code, including code used by
> others.  Windows depends on file extensions.  Fortunately, fixes
> using getRversion are not too difficult.
> 

Then you'll be happy to hear that Steve put together a patch and it's 
already committed, so it should make it into 2.7.1.  The patch adds the 
extension if there's no dot in the name, leaves the filename as-is if it 
sees one.  So this should be compatible with the majority of uses, only 
messing up cases where people really don't want an extension (now 
they'll have to add a dot at the end of their filename), or where they 
want an automatic one, but have another dot in the name.

Duncan Murdoch



More information about the R-devel mailing list