explaingit

philipl/pifs

6,897CAudience · developerComplexity · 3/5Setup · hard

TLDR

A joke filesystem written in C that stores files by recording where their bytes appear in the digits of pi rather than saving the actual data, it works and compiles, but storing a 400-line file takes five minutes.

Mindmap

mindmap
  root((pifs))
    What it is
      Joke filesystem
      Working C code
      FUSE-based
    The concept
      Pi is infinite
      Every sequence in pi
      Store positions not bytes
    Practical reality
      Extremely slow
      Not for real use
    Build requirements
      autoconf
      libfuse
      Linux only
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Mount the filesystem and demonstrate the concept of pi-based storage to amuse colleagues at a hackathon or talk

USE CASE 2

Study a minimal FUSE user-space filesystem implementation in C as a learning example

USE CASE 3

Use it as a conversation starter about what it means mathematically for pi to be a normal number

Tech stack

CFUSEautoconf

Getting it running

Difficulty · hard Time to first run · 1h+

Requires autoconf, automake, and libfuse on Linux, does not run on macOS or Windows.

In plain English

This is a joke filesystem built in C. It is called πfs (pi-fs) and it rests on a real mathematical idea taken to an absurd practical conclusion: the constant pi (3.14159...) is conjectured to be a "normal" number, meaning every possible finite sequence of digits appears somewhere in it. If that conjecture is true, then every possible file that could ever exist is technically already encoded somewhere in the digits of pi. πfs takes this observation and implements a filesystem around it. Instead of storing your file's actual bytes on disk, it looks up each byte in the digits of pi and records the position where that byte was found. Your file is then "stored" as a list of positions in pi rather than as raw data. The metadata (the list of positions) is saved to a directory you specify. The actual data lives in pi, which is infinite and not on your hard drive. The practical result is exactly what you would expect from this approach: it is extremely slow. The README notes that storing a 400-line text file took five minutes during testing. This is because finding each individual byte's location in the digits of pi takes real computation time, and a typical file has many bytes. Building it requires autoconf, automake, and libfuse, which is the standard Linux library for building user-space filesystems. The build process is a standard configure-and-make sequence. Mounting it is one command where you specify a metadata directory and a mount point. The README is written in a deadpan promotional style, treating 100% compression as a solved problem and suggesting future improvements like cloud-based pi lookup and Hadoop integration. The project is a working piece of software in the sense that it compiles and mounts, but it is not intended for any real use.

Copy-paste prompts

Prompt 1
How does pifs actually store a file? Walk me through step by step what happens when I write a text file to the pi filesystem.
Prompt 2
Show me the exact commands to build and mount pifs on Ubuntu from scratch, starting with git clone.
Prompt 3
Explain the normal number conjecture behind pifs, what does it mean for pi to contain every possible file, and is that conjecture proven?
Prompt 4
Why does pifs take 5 minutes to store a 400-line file? Walk me through where the computation time actually goes.
Open on GitHub → Explain another repo

← philipl on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.