[Rd] another save/load problem, only(?) affecting ascii = TRUE (PR#507)

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
03 Apr 2000 17:09:35 +0200


maechler@stat.math.ethz.ch writes:

> tstf2 <- function(n = 500)
> {
>     ## Author: Martin Maechler, Date: 1 Apr 2000, 15:40
>     n %/% 2
> }
> 
> save(tstf1, file="foo1",ascii=TRUE); load(file="foo1")
> ## Error in load(file = "foo1") : NewReadItem: unknown type -1073749696
> save(tstf2, file="foo2",ascii=TRUE); load(file="foo2")
> ## Error in load(file = "foo2") : NewReadItem: unknown type 92

Squished (I think). Problem was that nonprinting characters (incl. the
Space character) were printed in octal using %o format in
OutStringAscii. That should be %.3o to ensure that exactly three octal
digits get printed. Otherwise we're in trouble every time a digit
follows a space. 

I kind of suspect that there's really no reason to escape spaces like
that, but we'd have the same problem with other unprintables.

The $ffff question is whether %.3o is guaranteed to work on all
platforms.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._