Skip to content

Suggestion: Re: Fatal error .RData

7 messages · Hadley Wickham, Duncan Murdoch, Henrik Bengtsson +1 more

#
R-core, may I suggest that the error message returns the absolute path
(or even the relative path) and not just the filename/basename, e.g.

"Fatal error: unable to restore saved data in C:/Users/foo/.RData"

/Henrik
On Thu, Sep 18, 2008 at 6:41 AM, Green, Paul <pgreen at umich.edu> wrote:
#
And does it need to be a fatal error? load("test.txt") doesn't produce
a fatal error even though the file clearly isn't in the correct
format.

Or is there the possibility that loading a malformed rdata file
introduces memory corruption?
On Thu, Sep 18, 2008 at 9:55 AM, Henrik Bengtsson <hb at stat.berkeley.edu> wrote:

  
    
#
On 18/09/2008 10:55 AM, Henrik Bengtsson wrote:
That's a good suggestion, but unfortunately not quite trivial:  the code 
that prints that message has no idea what the full filename is.  On 
Unix, R just tries to open ".Rdata" without ever expanding the name, and 
on Windows, the full name is stored in a place that this code can't see.

So it's not impossible to fix this, but it would take some rearrangement 
of things.  I'm busy on other things so I'm not going to volunteer to do it.

Duncan Murdoch
#
Hi.
On Thu, Sep 18, 2008 at 8:16 AM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
Curious:  I'm not sure I get it (and I'm sure the code has the
answer), but to open any file (on a file system) there must be a
filename.  I understand the case when you open a connection and then
pass the connection to another function where the a error occur, but
here it seems to know that the name is '.RData', or is that just
hardwired in the error message?  Are you saying that only then name is
passed by the path is unknown?   If R code, then the outer function
can use tryCatch() to catch errors.

If all this is implemented in cross platform R code, I can have a look
at it.  What functions are involved here?

/Henrik
#
On 18/09/2008 12:13 PM, Henrik Bengtsson wrote:
Yes, it's hardwired.

  Are you saying that only then name is
This is part of the C code running while R is being initialized.
setup_Rmainloop in main.c prints the message, the name is stored in 
workspace_name, a static global variable hidden in startup.c.  The 
easiest approach would be to add a get_workspace_name function, but C is 
so poor in handling functions returning strings that I can't be bothered.

Duncan Murdoch
#
On 18/09/2008 12:23 PM, Richard M. Heiberger wrote:
Only on Unix-alikes, and the code that prints the error message is 
platform neutral.  And at the point where we need this message, R isn't 
running, so we'd need this in C code.  Not hard, just boring and time 
consuming.

Duncan Murdoch