tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: split(1): add '-c' to continue creating files



Ignatios Souvatzis <is%netbsd.org@localhost> wrote:
 
> Definitely O_EXCL and EEXIST, yes. But we still can fall into a hole
> in the sequence, fill it, and skip over the remaining part(s), thus
> interleaving our new and the preexisting files.

Ah, you mean if I currently have

$ ls
xaa xad xae

and then run

$ split -n 4 -c file; ls
xaa xab xac xad xae xaf xag
    --- ---         --- ---


I don't see a way around that: split(1) would need to
look ahead at _any_ possible file to be able to
determine if the current file name falls into a hole
in the sequence.

If you think it's worth calling out, we could try to
do so in the manual page:

"If the -c flag is specified, split will instead
continue to generate output file names until it finds
one that does not already exist.  (Note: this may fill
a "hole" in a pre-existing sequence of files such that
the final list of all output files may end up out of
sequence.)"

?

-Jan


Home | Main Index | Thread Index | Old Index