Something went wrong. Try again.
Monorepo for the nibling.run platform
Something went wrong. Try again.
1234567891011121314151617181920212223242526// Inode numbers identify entries, not paths: distinct files never share one, and an// entry keeps its ino through rename and truncating writes, as on POSIX.import { test, expect } from "@playwright/test";import { guestLines } from "./guest";
test("inode numbers are unique per entry and stable across rename and overwrite", async ({ page }) => { const lines = await guestLines(page, { "/app/main.cjs": ` const fs = require("node:fs"); fs.writeFileSync("/app/server.cjs.txt", "a"); fs.writeFileSync("/app/style.css", "b"); const a = fs.statSync("/app/server.cjs.txt").ino; const b = fs.statSync("/app/style.css").ino; console.log("distinct", a !== b); fs.renameSync("/app/style.css", "/app/moved.css"); console.log("rename keeps", fs.statSync("/app/moved.css").ino === b); fs.writeFileSync("/app/moved.css", "longer content"); console.log("overwrite keeps", fs.statSync("/app/moved.css").ino === b); fs.unlinkSync("/app/moved.css"); fs.writeFileSync("/app/moved.css", "new"); console.log("recreate differs", fs.statSync("/app/moved.css").ino !== b); `, }, "/app/main.cjs"); expect(lines).toEqual(["distinct true", "rename keeps true", "overwrite keeps true", "recreate differs true"]);});