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•53m ago

Comments

schoen•37m 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•28m 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•36m 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•34m 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•33m 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•17m 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.

However, "delete" is not a POSIX term for unlinking, or removing a file.

A few geek quizzes for time to pass

https://textlog.cc/tag/quiz?chunk=5
1•stagas•1m ago•0 comments

Pyshackle: A hard pre-execution gate for AI agent tool calls (open source)

https://pypi.org/project/pyshackle/
1•SHACKLE-PRO-•2m ago•0 comments

Map of stars around Earth out to 40 light years

https://claude.ai/code/artifact/872ab302-5cb2-4a95-ae66-7c0144177b53
1•EthanHeilman•4m ago•0 comments

US diplomat secretly flown home ‘had child abuse images at flat’

https://www.thetimes.com/uk/crime/article/us-diplomat-flown-home-immunity-bv58b3v7q
3•Betelbuddy•6m ago•1 comments

Dario Amodei says China presents 'toughest dilemma' for his proposed AI slowdown

https://www.cnbc.com/2026/09/13/china-dilemma-ai-slowdown-anthropic.html
3•donsupreme•8m ago•0 comments

Show HN: Pinocchio: Harness for Verifiable Work

https://pinocchio.goedelmachines.com
1•lazaruslong•9m ago•0 comments

MOBA: Mixture of Block Attention for Long-Context LLMs

https://arxiv.org/abs/2502.13189
1•ur-whale•9m ago•0 comments

Show HN: sengi.ai — Verified candidate sourcing for hard-to-fill roles

https://sengi.ai/
1•vmalyi•14m ago•0 comments

GCC 13.5 Released With 265 Bug Fixes

https://www.phoronix.com/news/GCC-13.5-Released
1•fork-bomber•17m ago•0 comments

Qalb: A programming language that uses the Arabic script instead of Latin

https://nas.sr/%D9%82%D9%84%D8%A8/
1•Muhammad523•19m ago•1 comments

Show HN: An agent that calculates how energy levels affect your goal progression

https://www.youtube.com/watch?v=FVUH2mna41g
1•ifeanyi_sa•19m ago•0 comments

The Case of Yemen's .YE Country-Code Domain

https://freethedotye.org/blog/when-militia-owns-ye/
2•FreeTheDotYE•23m ago•0 comments

How Mike Will Made It

https://www.newyorker.com/magazine/2016/07/11/how-mike-will-made-it
2•georgex7•25m ago•0 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/
6•dgellow•32m ago•1 comments

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

https://www.youtube.com/watch?v=koclOnlde0E
36•chadgpt3•34m ago•11 comments

The History of the Internet - Tay Zonday [video]

https://www.youtube.com/watch?v=y15olL4kzOA
1•CharlesW•36m ago•0 comments

Playing Bad Apple on the brain of a simulated fruit fly

https://www.reddit.com/r/oddlyterrifying/comments/1w9yhqv/playing_bad_apple_on_the_brain_of_a_sim...
1•robotnikman•36m ago•0 comments

Ask HN: One month, zero paying customers – keep it or kill it?

2•iGag•40m ago•2 comments

Molt – Thermally aware QLORA fine-tuning for Windows laptop GPUs

https://github.com/PraveenNimilka/MOLT
1•PraveenNimilka•40m ago•0 comments

AI Agent Doesn't Need a Bigger Prompt. It Needs a Data Catalog

https://aeroscissorz.github.io/aeroscissorz/posts/knowledge-catalog/
2•aeroscissorz1•41m ago•0 comments

What Is to Be Done? (2023)

https://twitter.com/pmarca/status/1666113642709020672
1•tosh•44m ago•0 comments

The tab is coming due for America's borrowing binge

https://www.axios.com/2026/09/13/national-debt-interest-rates-rising
2•toomuchtodo•44m ago•2 comments

Image to SVG in the browser, with no upload and real point editing

https://getsvg.app/
2•msmode•44m ago•0 comments

Calspan Bicycle and Motorcycle Dynamics Reports

http://bicycle.tudelft.nl/schwab/Bicycle/calspan/
1•Bluestein•46m ago•0 comments

Google is ending Gmail 'Send as' support for third-party accounts

https://proton.me/blog/gmail-ends-send-as-third-party
2•sltkr•46m ago•0 comments

The Air Computer

https://thechipletter.substack.com/p/the-air-computer
2•klelatti•47m ago•0 comments

Suicidal Compassion: Utilitarianism at AI Companies Endangers Humanity

https://ai-frontiers.org/articles/suicidal-compassion-how-utilitarianism-at-ai-companies-endanger...
3•YeGoblynQueenne•49m ago•0 comments

Government Survey Finds More Screentime Means Lower Scores for Japanese Students

https://www.nippon.com/en/japan-data/h02871/
3•akyuu•49m ago•0 comments

Rhizome ArtBase

https://artbase.rhizome.org/wiki/Main_Page
4•themaxdavitt•49m ago•0 comments

One event, five status codes and a class

https://percentes.ai/writing/2026/one-event-five-status-codes-and-a-class/
3•itsveems•50m ago•0 comments