Message Boards Message Boards


SetOptions no longer affects Put and PutAppend?

Posted 11 months ago
1 Reply
5 Total Likes

Before Mathematica version 10 it was possible to change globally the PageWidth option used by Put and PutAppend via SetOptions:

(* for Put *)
SetOptions[OpenWrite, PageWidth -> Infinity];

(* for PutAppend *)
SetOptions[OpenAppend, PageWidth -> Infinity];

Such possibility is very useful in practice because it allows to maintain a running log file with results of intermediate computations having one expression per line, using such efficient top-level functions as Put and PutAppend:

x >>> "log.txt"

Unfortunately starting from version 10 and up to the most recent version 11.2.0 SetOptions no longer affects Put and PutAppend — the above code doesn't change the default behavior (PageWidth -> 78). I know that it is possible in principle to use Export instead of Put, but it is much slower than Put. For PutAppend I don't know a top-level workaround at all.

I have two questions:

  1. Is it a bug?

  2. Is there a way to change the default PageWidth used by Put and PutAppend to PageWidth -> Infinity?

P.S. Related Mathematica.SE threads containing some low-level workarounds:

Reported to the support as [CASE:3965095].

Hi, It would be nice to have this fixed.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract