To combine a large number of large files into an even larger one, we currently use
cat file1 file2 ... output_file
but one wonders if this can be done faster than with this old friend.
Reading the sendfile() man page, you can specify the offset in * input_file *, from where to send the rest to * output_file *. But: can I also specify the offset in * output_file *? Or could I just iterate over all the input files, just leaving my output FD open and sendfile () 'ing again into it, effectively concatenating * input_files *? In other words: will the index file in my output FD remain at the end if I don’t close it and request it ()?
Does anyone know of such a cat implementation using sendfile() ?
Admittedly, I'm an administrator, not a programmer, so please bring my "real" coding knowledge ...
linux cat sendfile
Christian
source share