file_sorter
file_sorter
Module
file_sorter
Module summary
File sorter.
Description
This module contains functions for sorting terms on files, merging already sorted files, and checking files for sortedness. Chunks containing binary terms are read from a sequence of files, sorted internally in memory and written on temporary files, which are merged producing one sorted file as output. Merging is provided as an optimization; it is faster when the files are already sorted, but it always works to sort instead of merge.
On a file, a term is represented by a header and a binary. Two options define the format of terms on files:
{header, HeaderLength}
-
HeaderLength
determines the number of bytes preceding each binary and containing the length of the binary in bytes. Defaults to 4. The order of the header by