fakeroot

Crates.iofakeroot
lib.rsfakeroot
version0.4.1
sourcesrc
created_at2023-06-21 04:56:32.128779
updated_at2023-07-01 01:47:07.161584
descriptionA lightweight and batteries-included status_command for i3 and sway
homepagehttps://github.com/acheronfail/istat
repositoryhttps://github.com/acheronfail/istat
max_upload_size
id895859
size15,026
(acheronfail)

documentation

README

crate documentation

fakeroot

A simple crate which provides the ability to redirect filesystem calls. This crate builds a library that can be used via LD_PRELOAD.

Some examples follow.

Intercept a file:

mkdir /tmp/etc
echo "tee hee" > /tmp/etc/hosts
FAKEROOT="/tmp" LD_PRELOAD="path/to/libfakeroot.so" cat /etc/hosts
# tee hee

Intercept a directory list:

mkdir /tmp/etc
echo "whatever" > /tmp/etc/🪃
FAKEROOT="/tmp" FAKEROOT_DIRS=1 LD_PRELOAD="path/to/libfakeroot.so" ls /etc
# 🪃

Options are configured via environment variables:

  • FAKEROOT: absolute path to the fake root
  • FAKEROOT_DIRS: whether or not to intercept directory listing calls too
  • FAKEROOT_ALL: whether or not to fake non-existent files and directories
  • FAKEROOT_DEBUG: if set, will debug log to STDERR

License: GPL-3.0-only

Commit count: 317

cargo fmt