Repositories / agent-snapshot.git

test_programs/fork_and_usr.py

Clone (read-only): git clone http://git.guha-anderson.com/git/agent-snapshot.git

Branch
325 bytes · 1d6f8222e659
import os from pathlib import Path testdata = Path(os.environ["AGENT_SNAPSHOT_TEST_REPO"]) pid = os.fork() if pid == 0: (testdata / "child_output.txt").write_text("child final\n") os._exit(0) with open("/usr/bin/env", "rb") as handle: handle.read(16) for _ in testdata.iterdir(): pass os.waitpid(pid, 0)