config

OpenBSD system configuration
git clone git://jacobedwards.org/config
Log | Files | Refs | README

commit 5dd1038fb50172da330c6cd3bc1175499214535d
parent aa64fa37caea68161c96b43a789e719f767fe8b2
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date:   Sat,  3 Apr 2021 18:39:17 -0700

Improve efficiency of the bwrite shell function

Make sure the temporary file is in the same filesystem as the
destination file so it can simply be renamed instead of copied.

Diffstat:
Mlocal/shell/.local/share/shell/etc | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/local/shell/.local/share/shell/etc b/local/shell/.local/share/shell/etc @@ -2,7 +2,7 @@ fed() (cd "${XDG_DATA_HOME:-$HOME/.local/share}/feed" && feed "$@") bwrite() ( - tmp="$(mktemp -t proc-XXXXXXXXXX)" + tmp="$(mktemp "$(dirname "$1")/bwrite-XXXXXXXXXX")" cat >"$tmp" mv "$tmp" "$1" )