2
   -width=NUMBER
          number of columns for formatting of dumps, default is 80.

My question: "-width=999999" is not so good.. "-width=0" isn't working. How can I give the "-width" an infinite number?

UPDATE: I am just trying to download a txt file (that has longer lines) with:

lynx --dump foo.com/bar.txt
gasko peter
  • 5,514

1 Answers1

1

short: you can't do this with lynx

long: the -width option applies to formatted output. wget and curl do not format their output (those are comparable to the -source option of Lynx).

Formatted output pertains to what you see on the screen. Except for demonstration purposes, your screen will be no more than a few hundred columns of text (usually much less).

While most fixed-length buffers have been rewritten in the source code, the maximum line-length for formatted output from Lynx is still a compiled-in constant (1024). Changing that is more than simply changing a number and recompiling, because Lynx manages memory pools which include data structures containing these (fixed-length lines). If you increased the maximum length of a line, then that would change the block-size used for the memory pool (or make it less efficient by storing fewer lines in a block).

The command-line -width option is limited because of this, in the main program:

/* -width */
static int width_fun(char *next_arg)
{
    if (next_arg != 0) {
    int w = atoi(next_arg);
if (w > 0)
    dump_output_width = ((w < MAX_COLS) ? w : MAX_COLS);
}

return 0;

}

Further reading: src/GridText.c, where the relevant data structures are defined.

Thomas Dickey
  • 76,765