Linux >2.6.33: could sendfile() be used to implement a faster 'cat'?
问题 Having to concatenate lots of large files into an even larger single one, we currently use cat file1 file2 ... output_file but are wondering whether it could be done faster than with that old friend. Reading the man page of sendfile() , one can specify an offset into *input_file*, from where to send the remainder of it to *output_file*. But: can I also specify an offset into *output_file*? Or could I simply loop over all input files, simply by leaving open my output FD and sendfile()'ing