[R] source(file) => file becomes readonly

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Sep 21 22:57:21 CEST 2005


This was not really accurate.

Being `read-only' is a Windows phenomenon on open files (even files open 
for reading).  In 2.0.1 and 2.1.1 the file was open whilst it was parsed 
and so `read-only' during that time. In 2.0.1 it was then closed, but in 
2.1.1 it was (potentially) opened several times to find an encoding, 
parsed and left open until source() terminated.  In 2.2.0 it will be 
closed once it has been parsed.

Changing a file after it has been parsed will have no effect, so there is 
no reason to prevent it (beyond that was the simplest way to implement 
choosing a suitable encoding).

On Thu, 1 Sep 2005, Hjellvik Vidar wrote:

> The OS is Windows XP.
> I use to work on the file while it's executed and save changes 
> continually. It doesn't seem to have any effect on the current 
> execution. I just find it annoying not to be able to do it. It's not 
> crucial, but if there is some easy way around it I would like to 
> know....
>
> -----Original Message-----
> From: Uwe Ligges [mailto:ligges at statistik.uni-dortmund.de]
> Sent: 1. september 2005 14:21
> To: Hjellvik Vidar
> Cc: r-help at stat.math.ethz.ch
> Subject: Re: [R] source(file) => file becomes readonly
>
>
> Hjellvik Vidar wrote:
>
>> Hello,
>> when I work in R, I write code in a text file that I run with the "source(filename)" command. In R2.1.1 the file is read-only while the source command is executed. This was not the case in R2.0.1. Is this a bug-fix or is it possible not to have the file read-only when executed?
>
> So you want to modify a file *while* it is executed?
> Sounds dangerous to me, you may want to explain further...
>
> BTW: Which OS are we talking about?
>
> Uwe Ligges
>
>
>> Best regards
>> Vidar
>>
>> ______________________________________________
>> R-help at 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
>
> ______________________________________________
> R-help at 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
>

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