Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Love it.

Too bad there aren't enough Mac users to prompt a similar backlash against Macs littering every computer they visit on the network with .DS_Store and other turds.



This isn't remotely comparable. Those .DS_Store files are created in arbitrary directories by the Apple file manager or something. The SQLite temp files are created in the OS-specific temporary directory (e.g. C:/Users/username/AppData/Local/Temp or whatever on Windows) which is specifically intended for that purpose. SQLite isn't doing anything wrong; that's where it's supposed to store temporary data that doesn't fit into memory.

The problem is that virus scanners sometimes misclassify those temp files as belonging to malware apps, or sometimes they might be written by real malware apps, but even in the latter case, that only happens because the malware uses sqlite as a library. The malware isn't written by the SQLite authors, so complaining to them is pointless.


You misunderstood what the comment in the code was saying.

Firstly, it not that anti-virus software was misclassifying it -- it's that a particular one, Mcafee, was USING sqlite. And more importantly, it didn't put the file(s) in the proper %temp% folder. Instead, it created it as `C:\temp\{name}.sqlite_`. This is why users found them suspicious and complained to devs.

Also keep in mind putting random files or folders under root of C:\ was, while never recommended, a common practice in 2000s (some still do so even today). So what Mcafee was doing is hardly unheard of. But people still freak out when they see these in their C:\ (TBH, understandable).

> %userprofile%


They're not arbitrary at all. They're in directories visited by Finder, storing the open/closed state of subdirectories, and apparently other view data.

Apple, in its arrogance and backwardness, doesn't store those choices on the BROWSING user's computer; it stores them in the directories on the computer being browsed... where, by the way, they'll be trounced by the next Finder user who comes along.


KDE's Dolphin does the same thing with .directory


> Those .DS_Store files are created in arbitrary directories by the Apple file manager or something.

.DS_Store files come from Apple's file systems containing a separate data and resource fork. APFS can natively store the contents, but for foreign file systems/network shares, a .DS_Store file is created to store those attributes.


I don't have OCD but the casing of .DS_Store annoys me a lot for some reason. I have turned on option to display dot files in finder and I see this god awful name everywhere. It could be .DSStore, .ds_store, .DS Store or even .DS_STORE, current one is the worst.


> .DS_Store files come from Apple's file systems containing a separate data and resource fork

No, that would be ._<filename> files (containing resource forks, when the corresponding file is stored on a volume with a FS not supporting them natively), which are much rarer these days given that resource forks are not really used anymore.

.DS_Store contains Finder metadata, as far as I know (non-default icon sorting or positioning, categories, tags etc.), and they occur on all volumes, including Mac native filesystems. Finder just hides them by default.


I never knew that. How come they end up in Git repositories then? They shouldn't be visible to Git running on a native Mac filesystem?


They're just a file, so git can see it. Good habit would be to add it to the project's gitignore, or your global gitignore (or both)


It's a pet peeve of mine when people put stuff like this in a project's `.gitignore`. The proper place is either your global gitignore (probably appropriate for stupid stuff like this) or in your clone in `.git/info/exclude`.

`.gitignore` is for stuff that all developers need to ignore, like compiler output, and should be kept to the bare minimum.


> .gitignore` is for stuff that all developers need to ignore

But that is the case, all developers need to ignore the ".DS_Store" files. So by your own rule it is appropriate in there then?


I think the point is that only developers on Macs need to ignore them. If they properly do so, these files will never appear on other developer’s machines, and they therefore don’t need them in .gitignore.


It’s not that straightforward to ignore files in git without adding them to a local .gitignore, though.

Global .gitignore exists, but I just had to look it up again to refresh my memory – chances are, junior devs or hobby developers will never even consider it as an option.

That said, arguably ignoring .DS_Storage should be the default on macOS builds of git.


I just teach people about global gitignores then they know. If someone were to commit something to an open source project, I'd reject it and teach them about it too. I'm all about the global gitignores. The ignore file can actually act as a form of documentation if kept tidy. It's a single source of truth of all the artifacts an app can produce.


he must meant that you block something at its origin: dsstore managed by the OS, you block it at system level; `.o` produced by the project stuff, block it at project repo level.


I must admit that my viewpoint is coloured by the fact that I work on repos where most devs use OSX.

I can do the principled thing as you describe it. And then I can be angry every time a new dev arrives who doesn't have their computer correctly set up yet, or someone reinstalls their machine, or anything like that.

Or I can do the pragmatic thing, add one extra line to the .gitignore file and forget about it forever.

In my opinion this is not a hill worth dying on.


I can see an argument for this being semantically correct, but in practice I think it's preferable to have the repo checkout in the closest configuration to correct for new developers who will start contributing.

And, for what it's worth, all developers need to ignore .DS_Store files regardless if Finder creates it or it gets placed in when you unzip something created on a Mac, for instance.

In the best case, you spend extra time needlessly denying PRs and bothering people who already likely don't know git well enough to cleanly fix their commit. In the case of a repo large enough that you're not the only person approving PRs, I'd say it's almost inevitable that they eventually slip through.

Just my 2¢ from experience working in the industry.


TIL there's a global gitignore, thanks!


So they are not a resource fork, then.


They are visible to programs, for example if you run `ls -a` you will see them on macOS too. I reckon they're only transparent to Finder (where you can't see them even if you're showing hidden files).


.DS_Store files are totally out of control: https://twitter.com/rdohms/status/1667554818603245570


You mean like those thumbs.db files windows leaves on every computer they visit on the network?


Windows XP is the last Windows version that does this.


Not to mention that I think you'd have to be browsing in some non-list view for it to even be generated.


You can avoid creating .DS_Store files on network and USB volumes like so.

  defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
  defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true


Good tip, thanks.


.DS_Store has a origin story though not as entertaining https://www.arno.org/on-the-origins-of-ds-store


Apple's perennial lack of interest in truly fixing Finder shows in the fact that they've left this ridiculous bug in there for 20+ years, despite yet another "ground-up rewrite" that was supposed to (or did) happen at some point in the 2010s.

My other favorite Apple filesystem cock-up is the inclusion of a "Contents" directory in every bundle, which never has any siblings. I mean... what kind of ass thinks that a directory needs a subdirectory to hold the contents of itself?

The one thing Apple fixed in Finder that annoyed the living #$%! out of me for all previous years was that you couldn't sort files WITH FOLDERS AT THE TOP. Of course the fix was incomplete, broken in some places at first, including your Desktop directory. But that did get fixed surprisingly quickly.


That's the fault of whoever owns the other computers. If a user ever littered files all over my computer I would revoke write access until they fix their shit.


  desktop.ini




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: