SpaceCadet

joined 1 year ago
[–] SpaceCadet@feddit.nl 2 points 2 months ago

as the binary is already loaded into memory

That’s not the reason why it continues. It’s because there’s still a file descriptor open to rm.

[–] SpaceCadet@feddit.nl 2 points 2 months ago* (last edited 2 months ago)

That’s not the reason why it continues. It’s because there’s still a file descriptor open to rm.

[–] SpaceCadet@feddit.nl 18 points 2 months ago* (last edited 2 months ago)

In Unix/Linux, a removed file only disappears when the last file descriptor to it is gone. As long as the file /usr/bin/rm is still opened by a process (and it is, because it is running) it will not actually be deleted from disk from the perspective of that process.

This also why removing a log file that's actively being written to doesn't clear up filesystem space, and why it's more effective to truncate it instead. ( e.g. Run > /var/log/myhugeactivelogfile.log instead of rm /var/log/myhugeactivelogfile.log), or why Linux can upgrade a package that's currently running and the running process will just keep chugging along as the old version, until restarted.

Sometimes you can even use this to recover an accidentally deleted file, if it's still held open in a process. You can go to /proc/$PID/fd, where $PID is the process ID of the process holding the file open, and find all the file descriptors it has in use, and then copy the lost content from there.

[–] SpaceCadet@feddit.nl 2 points 2 months ago* (last edited 2 months ago) (1 children)
[–] SpaceCadet@feddit.nl 2 points 2 months ago* (last edited 2 months ago)

Leave the poor kernel out of it, it has nothing to do with this. It's Lennart, not Linus.

[–] SpaceCadet@feddit.nl 3 points 2 months ago (1 children)

I don't think it's intended as a "solution", it just lets the clobbering that is caused by the case insensitiveness happen.

So git just goes:

  • checkout content of README.md to README.md (OS creates README.md)
  • checkout content of README.MD to README.MD (OS overwrites README.md)

If you add a third or fourth file ... it would just continue, and file gets checked out first gets the filename and whichever file gets checked out last, gets the content.

[–] SpaceCadet@feddit.nl 4 points 2 months ago (3 children)

It tells you there's a name clash, and then it clones it anyway and you end up with the contents of README.MD in README.md as an unstaged change.

[–] SpaceCadet@feddit.nl 1 points 2 months ago* (last edited 2 months ago)

That’s some suckless level cope

Thanks, really constructive way of arguing your point...

Who really cares about some programming purity aspect?

People who create operating systems and file systems, or programs that interface with those should, because behind every computing aspect is still a physical reality of how that data is structured and stored.

What’s correct is the way that creates the least friction for the end users

Treating different characters as different characters is objectively the most correct and predictable way. Case has meaning, both in natural language as well as in almost anything computer related, so users should be allowed to express case canonically in filenames as well. If you were never exposed to a case insensitive filesystem first, you would find case sensitive the most natural way. Give end users some credit, it's really not rocket science to understand that f and F are not the same, most people handle this "mindblowing" concept just fine.

Also the reason Microsoft made NTFS case insensitive by default was not because of "user friction" but because of backwards compatibility with MSDOS FAT16 all upper case 8.3 file names. However, when they created a new file system for the cloud, Azure Blob Storage, guess what: they made it case sensitive.

[–] SpaceCadet@feddit.nl 6 points 2 months ago

Unix was designed for mainframes

Unix was never for mainframes. It was for 16-bit minicomputers that sat below mainframes, but yes they were more advanced than the first personal computers.

It’s actually impressive how much modern/business functionality they were able to cram into that.

Absolutely, but you have to admit that it's a less solid foundation to build a modern operating system on.

In the 80s, there were several Unices for PC too btw: AT&T, SCO, even Microsoft's own Xenix. Most of them were prohibitively expensive though.

[–] SpaceCadet@feddit.nl 2 points 2 months ago

Platforms like reddit and Tumblr benefit from a friction-free sign up system.

Even on Reddit new accounts are often barred from participating in discussion, or even shadowbanned in some subs, until they've grinded enough karma elsewhere (and consequently, that's why you have karmafarming bots).

[–] SpaceCadet@feddit.nl 1 points 2 months ago

Is this a problem here?

Not yet, but it most certainly will be once Lemmy grows big enough.

view more: ‹ prev next ›