-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 Amadeusz Żołnowski: > Göktürk Yüksek <gokt...@gentoo.org> writes: >>> + cat "${f}" >"${tmpf}" || return 1 >> Why shell redirection with cat instead of cp? both are in >> coreutils. > > I thought cp could overwrite file mode of already existing tmp > file, but actually it doesn't, so cp can be here as well. Is there > actual benefit of using cp here? > There could be some performance implications. cat will usually do slow, buffered I/O. cp tries to be smarter with allocation, i.e. it may take advantage of the btrfs specific clone to do a O(1) copy.
>> Also, wouldn't the absence of 'die' cause silent breakages? > > I want to caller decide whether die or not and what error messge > to give. > Maybe that should be part of the documentation. People are more likely to assume that it will die on its own, I think. Is there a case in which you would not want to die? > Cheers, > -----BEGIN PGP SIGNATURE----- iQEcBAEBCgAGBQJXPPtVAAoJEIT4AuXAiM4zhX4H+gNivSvNvQzf3tsjmbVatGWB DLIvIxUY7h79c0YDTXnaU+4LLf7CvED26XT9QNWp297OfNpsXKWGTR5GbdG+w0ab SR490l9Uh/qn8HBKvh1hmPTEyeRHXm0ZoQ6/jrgwlz7ehSawQlzGRUPqFOHj88Fc qwWhKk1p2fc7TUnRO0SUY/xcRyZeEyUqEG3ueVYfPlTo10rC5+B20IFjnO09vwbT INV27KHqjLnpRT4xGWvCyCiEfw6DDypxZ/PKfr4c7omHF8OF+5GGnf+FFZ8UJFkt 93TVIPDeUC9XeAsmqirgN5LuYWsNNUwTEdiDfjglLrTb6OgXA0eIIwXsGH/G3d4= =J3uT -----END PGP SIGNATURE-----