]> git.ipfire.org Git - thirdparty/coreutils.git/commit
split: tune for when creating output files
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 4 Mar 2023 21:40:28 +0000 (13:40 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 4 Mar 2023 22:49:46 +0000 (14:49 -0800)
commit8022874d1242f3b094b6bd001e83845e289d2bb1
tree5cc1713dda09c25a301faff6d6af4fdb983ecd68
parent788654dd82ec204ccdcb84cc20c7595d20a5e5a1
split: tune for when creating output files

* src/split.c (create): Avoid fstat + ftruncate in the usual case
where the output file does not already exist, by trying
to create it with O_EXCL first.  This costs a failed open
in the unusual case where the output file already exists,
but that’s OK.
src/split.c