Voelker, Bernhard wrote: > Jim Meyering wrote: >> src/csplit: <2GiB of spaces>xx<2GiB of 0's>: File name too long > > I'm not an expert at all in this, but isn't there PATH_MAX on every system? > So the suffix format could be limited to `csplit -b %<PATH_MAX>d`. > Just a thought...
On some systems (e.g., Hurd) PATH_MAX is not even defined. ISTR that on others it is very large, like INT_MAX or UINT_MAX. Where it is defined, we could do something like that. Or even better, use a limit (again, if there is one) on the length of a file name, taking into account where any "/" are in the expansion of the format string. Whatever we do, the simpler it is the better, since this is solely to handle errors about ridiculously long file names.
