Message Boards Message Boards

SetOptions no longer affects Put and PutAppend?

GROUPS:

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

POSTED BY: Alexey Popkov
Answer
27 days ago

Hi, It would be nice to have this fixed.

POSTED BY: Rodrigo Murta
Answer
26 days ago

Group Abstract Group Abstract