Skip to content

source(file) => file becomes readonly

1 message · Hjellvik Vidar

#
That sounds fine! It will be as before in version 2.2.* then? The editor I use is Vim, which says that the file "is read-only", but I can override the protection. Wordpad says that the file is "in use by another application". In notepad it is saved without protests. It's especially when I use the browser() I like to edit and save the file while R has it open. 

Regards,
Vidar

-----Original Message-----
From: Duncan Murdoch [mailto:murdoch at stats.uwo.ca]
Sent: 22. september 2005 02:12
To: Prof Brian Ripley
Cc: Hjellvik Vidar; r-help at stat.math.ethz.ch; Uwe Ligges
Subject: Re: [R] source(file) => file becomes readonly
Prof Brian Ripley wrote:
But R doesn't open files in an exclusive mode.  It opens them in "share 
deny none" mode (_SH_DENYNO; this is an undocumented feature of the MSVC 
run-time library that MinGW uses).  I suspect whatever editor Hjellvik 
was using attempted to open the file with exclusive access, and when 
that failed (because R had it open), it fell back to read-only access.

It's certainly possible to open a file for write access in another 
process while R has it open for read access.  You just can't get 
exclusive access to it.

Duncan Murdoch