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

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

License

Notifications You must be signed in to change notification settings

asottile-archive/rename-exchange

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published