Live data from Hacker News

Man who thought opening a TXT file is fine thought wrong

paulosyibelo.com

91–100 of 316 posts

Re: Man who thought opening a TXT file is fine thought wrong

#91
post #78

Earlier quoted context omitted.

It also doesn't ship with a paint program. OSx has a lot of ground to cover before it can function as a decent desktop OS.

preview's basic annotation functions cover most of what paint can do, or am i missing something?

Preview annotations don't begin to scratch the surface of what paint can do. Look what some people can do in MS paint: https://www.techeblog.com/amazing-spider-man-ms-paint-drawin...

Most of us can't, but paint has all the tools, which is very helpful in many situations.

Re: Man who thought opening a TXT file is fine thought wrong

#92

Earlier quoted context omitted.

It also doesn't ship with a paint program. OSx has a lot of ground to cover before it can function as a decent desktop OS.

oh come on, how much more do you need than a crayon based color picker? ever set the date of your system to waaay into the future and then look at the crayon color picker? after providing that, what else could you possibly need?

What does that do?

Re: Man who thought opening a TXT file is fine thought wrong

#94

Two words: excessive complexity. It's always seemed strange that an application called TextEdit is actually more than a text editor. I strongly believe that content-type autodetection, much less HTML rendering(!), most certainly does not belong in a text editor.

shoulda used 'cat

Using cat with arbitrary input exposes you to many terminal-side security issues. It is insufficiently complex.

Re: Man who thought opening a TXT file is fine thought wrong

#96

File extensions are a kludge anyway. (And Windows 10 still hides them by default, because hey, backwards compatibility, and you wouldn't want to confuse Grandma who's seen the file be called "grandkids" since Windows 95..). Why should the filetype be dependent on the name? People even think renaming a .BMP to .JPG means now it's a compressed file! Old school Macs stored the filetype outside of a file, so you can rena…

Not really outside. The metadata was stored in a so-called "resource fork", with the file contents proper in a "data fork", both of which belonged to the file per se. Part of the resource fork was the "creator code", four bytes identifying the application which had created or could open the file, and the "type code", four more bytes defining which, among the potentially many kinds of files a given application could o…

The file type and creator type are stored in the Finder Info meta data which is in the file record (along with the creation date, file size, etc).

Re: Man who thought opening a TXT file is fine thought wrong

#97
post #94

Earlier quoted context omitted.

Using cat with arbitrary input exposes you to many terminal-side security issues. It is insufficiently complex.

Such as?

Any vulnerability in the escape sequence handling of the terminal emulator, and conceivably, depending on what sequences your terminal supports, access to facilities like local file generation or clipboard contents. There have been a number of issues with escape sequences injected into things people might copy and paste from a web page, or in git commit histories, that have done nefarious things.

Re: Man who thought opening a TXT file is fine thought wrong

#98

Earlier quoted context omitted.

If you don't want text editors to do non text-editing stuff, then people need to stop saying we should build development environments around text editors. "An IDE is just a text editor with bells and whistles", people say. Well if that's the case, it's not surprising if people "only ship the one text editor".

But not with file extensions of .txt. They should only do bells and whistles if the extension warrants some bells. .md, sure syntax highlight me. But opening .txt and treating it as html, that seems strange.

[deleted]

Re: Man who thought opening a TXT file is fine thought wrong

#99
post #94

Earlier quoted context omitted.

Using cat with arbitrary input exposes you to many terminal-side security issues. It is insufficiently complex.

Such as?

Cat has long been known to expose you to code execution, among other things.

https://security.stackexchange.com/questions/56307/can-cat-i...

Re: Man who thought opening a TXT file is fine thought wrong

#100

File extensions are a kludge anyway. (And Windows 10 still hides them by default, because hey, backwards compatibility, and you wouldn't want to confuse Grandma who's seen the file be called "grandkids" since Windows 95..). Why should the filetype be dependent on the name? People even think renaming a .BMP to .JPG means now it's a compressed file! Old school Macs stored the filetype outside of a file, so you can rena…

I do remember resource forks, but I thought content-detection was also a generally accepted pattern on 90s-era Macs because of the lack of file extensions?

(If you had a safe content-detection code-path -- admittedly a harder thing to guarantee these days -- that could certainly be safer than relying on users to not "open grandkids.bmp.exe" or "rename a downloaded.txt to autoexec.bat".)

Post reply on HN