658
submitted 6 months ago* (last edited 6 months ago) by 0x4E4F@sh.itjust.works to c/linuxmemes@lemmy.world

Though the Windows thing was really funny ๐Ÿ˜‚.

you are viewing a single comment's thread
view the rest of the comments
[-] bort@sopuli.xyz 94 points 6 months ago

the linux-file-deletion is used as a example for good software design. It has a very simple interface with little room for error while doing exactly what the caller intended.

In John Ousterhout's "software design philosophy" a chapter is called "define errors out of existence". In windows "delete" is defined as "the file is gone from the HDD". So it must wait for all processes to release that file. In Linux "unlink" is defined as "the file can't be accessed anymore". So the file is gone from the filesystem immediately and existing file-handles from other processes will life on.

The trade-off here is: "more errors for the caller of delete" vs "more errors due to filehandles to dead files". And as it turns out, the former creates issues for both developers and for users, while the later creates virtually no errors in practice.

[-] lurker2718@lemmings.world 7 points 6 months ago

Yes, the file itself (so the data and inode) is not gone as long as the handles live on. Only the reference is gone. You canstill recover the file. https://superuser.com/questions/283102/how-to-recover-deleted-file-if-it-is-still-opened-by-some-process#600743

load more comments (14 replies)
this post was submitted on 22 Mar 2024
658 points (100.0% liked)

linuxmemes

20762 readers
1476 users here now

I use Arch btw


Sister communities:

Community rules

  1. Follow the site-wide rules and code of conduct
  2. Be civil
  3. Post Linux-related content
  4. No recent reposts

Please report posts and comments that break these rules!

founded 1 year ago
MODERATORS