frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

You delete a file on Linux while a program has it open. What happens? (quiz)

https://textlog.cc/post/3662?hn
11•stagas•1h ago

Comments

schoen•58m ago
This behavior is fairly general to Unix! A cute thing on Linux is that there are also references to open files under /proc, including synthetic kernel-generated filesystem links to the files, even if they've been deleted.

So if you delete a file from the filesystem that's open by PID 12345, you can find a reference to that file still present in /proc/12345/fd, and you can actually make a new copy of the file with cp or something.

cduzz•49m ago
And also when deleting a file that's on NFS, but it's reference count is non-zero in the kernel (because at least one process has it open) you end up renaming not deleting the file.
jmclnx•58m ago
Well I did not read the article, but here is what I think.

In the old days on an old 16 bit UNIX, I had to execute unlink to delete a file.

So I would say the inode # will be removed from the directory entry, leaving the file in place. So the program will continue on happily. On Linux, I think it depends on the file system. But I think it will continue until the file is overwritten. If the file is closed and re-opened after rm(1), the program will fail.

EDIT: I took the quiz. But I have to wonder if on a fs like zfs/btfs something different will happen.

quotemstr•55m ago
Shame that you can't then link /proc/self/fd/N to a different node in the filesystem namespace. That'd be neat and symmetric.
tux3•54m ago
Followup quizz:

A file is held open read only by a process, and then you delete the file. Under memory pressure and without swap, can Linux evict those pages to reclaim memory?

ButlerianJihad•38m ago
The file's blocks exist in the filesystem. "Those pages" just refers to the ordinary buffer cache for any other disk-based file. No cached pages are necessary to hold open a file on disk.
tux3•19m ago
Correct! It's still an inode, even without a path.
joey_spaztard•6m ago
The content of the file remains accessible to the process that has it open and continues to take up disk space.

... and a new file with the same name (and path) and different content can be created that exists at the same time.

This can be confusing.

"I'v updated that file on the server and it has not taken effect. I'v ssh'ed in and I can see the new version. What is going on? If I reboot that box the phone will start ringing..."

Why is Google still serving dodgy ads?

https://www.atomic14.com/2026/09/13/why-is-google-still-serving-dodgy-ads
200•iamflimflam1•2h ago•91 comments

Astra and Fable still hack on simple variants of alignment evals from 2025

https://www.lesswrong.com/posts/munJKF7iWMsWJLAH2/astra-and-fable-still-hack-on-simple-variants-o...
268•Levitating•5h ago•115 comments

Global Shortage Has Led to Motor Oil Rationing at Costco

https://guessingheadlights.com/global-shortage-has-led-to-motor-oil-rationing-at-costco/
23•mikhael•1h ago•7 comments

Data collected by cars and sold to third parties

https://www.theverge.com/column/994172/your-car-is-selling-your-data
149•bookofjoe•5h ago•90 comments

JetKVM Mini

https://jetkvm.com/blog/introducing-jetkvm-mini
445•taubek•11h ago•171 comments

I'm being cyberattacked by Tesla, Inc

https://dreamstation.systems/personal/tesla.html
268•robinpie•1h ago•77 comments

CUDA for AMD on Windows

https://github.com/Speedstu/CUDA-for-AMD-Windows
98•chiassedu80•5h ago•53 comments

Sean Carroll explains the biggest ideas in the universe – Full Interview [video]

https://www.youtube.com/watch?v=_TBNJyztai0
34•binyu•2d ago•5 comments

Flock cameras used to arrest a child for playing on a swing

https://www.youtube.com/watch?v=koclOnlde0E
77•chadgpt3•55m ago•31 comments

Why is the x86 undefined instruction called ud2? Why 2?

https://devblogs.microsoft.com/oldnewthing/20260910-00/?p=112689
130•ibobev•7h ago•34 comments

Reverse engineering my e-scooter and rewriting the firmware in Rust

https://bensimms.moe/reverse-engineering-scooter/
247•vinhnx•3d ago•66 comments

Reverse-Engineering Claude Web's MicroVM: Uncovering Anthropic's Hidden Antspace

https://aprilnea.me/en/blog/reverse-engineering-claude-code-antspace
14•rzk•2d ago•1 comments

Making Startups Powerful

https://paulgraham.com/powerful.html
80•tosh•5h ago•33 comments

Garry Tan wants US open-weight AI labs to 'distill' frontier models, too

https://techcrunch.com/2026/09/11/y-combinators-garry-tan-wants-u-s-open-weight-ai-labs-to-distil...
219•TheJCDenton•3h ago•106 comments

Why are AI agents lying, cheating and coordinating?

https://yoshuabengio.org/en/publication/why-are-ai-agents-lying-cheating-and-coordinating
525•jonifico•18h ago•608 comments

Device Drivers lab exercise – COSC562

https://web.eecs.utk.edu/~smarz1/courses/cosc562/drivers.html
9•azhenley•2h ago•1 comments

Cpak – OCI application package format for Linux desktops, servers and devices

https://cpak.it/
28•xlmnxp•4h ago•11 comments

David Sacks: OpenAI and Anthropic Don't Need Regulations to Pace Frontier Models

https://twitter.com/DavidSacks/status/2098973625252708460
136•kolanos•2h ago•102 comments

'Fingerprints' inside the Sun could reveal if it once swallowed a planet

https://ras.ac.uk/news-and-press/research-highlights/fingerprints-inside-sun-could-reveal-if-it-o...
92•blincoln•7h ago•35 comments

TailTalk: A modern async user space AppleTalk stack with Rust and Tokio

https://github.com/FeralFirmware/TailTalk/
56•zdw•19h ago•13 comments

Romania soccer introduces black card to 'combat abusive behaviour' from parents

https://www.nytimes.com/athletic/7586821/2026/09/12/football-black-card-referee/
58•thunderbong•2h ago•40 comments

Alan's Random Insult Generator (1999)

https://alanbellows.com/experiments/insult/index.html
51•DamnInteresting•2d ago•23 comments

Libraries Run Rust Inside Python (With PyO3)

https://belderbos.dev/blog/how-libraries-run-rust-inside-python/
37•lumpa•4h ago•26 comments

AI recursive self-improvement might not come so quickly after all (August 2026)

https://www.technologyreview.com/2026/08/18/1142188/ai-recursive-self-improvement/
10•dgellow•53m ago•5 comments

Make your first edit to OpenStreetMap

https://high5apps.github.io/josm-plugin-website-wizard/
570•juliantigler•1d ago•137 comments

Base84 deserves a place in file names

https://00f.net/2026/09/09/base84/
47•kevvok•2d ago•35 comments

Homebrew 7.0.0

https://brew.sh/2026/09/13/homebrew-7.0.0/
479•mikemcquaid•11h ago•192 comments

A Brief Retrospective on the Sprite Network Operating System

https://github.com/OSPreservProject/sprite/blob/master/sprite.txt
14•EvanAnderson•1d ago•9 comments

On Binary Translation and Its Consequences

https://chipsandcheese.com/p/on-binary-translation-and-its-consequences
38•matt_d•2d ago•16 comments

Key symbols we lost to time, pt. 1: The PC side

https://unsung.aresluna.org/key-symbols-we-lost-to-time-pt-1-the-pc-side/
72•leephillips•5h ago•25 comments