Skip to content
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.

Latest commit

 

History

History
66 lines (43 loc) · 1.29 KB

README.md

File metadata and controls

66 lines (43 loc) · 1.29 KB

ARCHIVED

it is feature complete and I don't plan on updating it further


Build Status pre-commit.ci status

rename-exchange

a tiny wrapper around renameat2(...) and RENAME_EXCHANGE to do atomic (directory) replacement

building

precompiled

see the releases tab for precompiled binaries.

with musl

smaller, static

musl-gcc -O3 -s -static main.c -o rename-exchange

with classic gcc

larger, dynamically linked

gcc -O3 -s main.c -o rename-exchange

support

as this uses renameat2(...) it can only be used on linux>3.15

usage

$ ls -l foo bar
bar:
total 0
-rw-r--r-- 1 asottile asottile 0 May 16 13:35 wat

foo:
total 0
-rw-r--r-- 1 asottile asottile 0 May 16 13:35 wat2

$ rename-exchange foo bar

$ ls -l foo bar
bar:
total 0
-rw-r--r-- 1 asottile asottile 0 May 16 13:35 wat2

foo:
total 0
-rw-r--r-- 1 asottile asottile 0 May 16 13:35 wat