Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asottile-archive/rename-exchange
tiny wrapper around renameat2(...) and RENAME_EXCHANGE to do atomic (directory) replacement
https://github.com/asottile-archive/rename-exchange
Last synced: 30 days ago
JSON representation
tiny wrapper around renameat2(...) and RENAME_EXCHANGE to do atomic (directory) replacement
- Host: GitHub
- URL: https://github.com/asottile-archive/rename-exchange
- Owner: asottile-archive
- License: mit
- Archived: true
- Created: 2021-05-16T21:14:32.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-04T19:11:11.000Z (10 months ago)
- Last Synced: 2024-08-04T01:12:26.857Z (4 months ago)
- Language: C
- Homepage:
- Size: 20.5 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ARCHIVED
it is feature complete and I don't plan on updating it further
___
[![Build Status](https://github.com/asottile/rename-exchange/actions/workflows/main.yml/badge.svg)](https://github.com/asottile/rename-exchange/actions)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/asottile/rename-exchange/main.svg)](https://results.pre-commit.ci/latest/github/asottile/rename-exchange/main)rename-exchange
===============a tiny wrapper around `renameat2(...)` and `RENAME_EXCHANGE` to do
**atomic (directory) replacement**### building
#### precompiled
see [the releases tab] for precompiled binaries.
[the releases tab]: https://github.com/asottile/rename-exchange/releases
#### with musl
smaller, static
```bash
musl-gcc -O3 -s -static main.c -o rename-exchange
```#### with classic gcc
larger, dynamically linked
```bash
gcc -O3 -s main.c -o rename-exchange
```### support
as this uses `renameat2(...)` it can only be used on linux>3.15
### usage
```console
$ ls -l foo bar
bar:
total 0
-rw-r--r-- 1 asottile asottile 0 May 16 13:35 watfoo:
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 wat2foo:
total 0
-rw-r--r-- 1 asottile asottile 0 May 16 13:35 wat
```