Explainer: .DS_Store Files
eclecticlight.co
eclecticlight.co
But it's a pretty darn good symbol for how Apple doesn't give a flying fuck about anyone's time/nerves, just dumping these on everyone without asking and letting us deal with their laziness.
Plus, Apple users then typically just rolled their eyes when I point out to them that I've now got all these files on my USB drive, thanks for nothing Apple. "Why do you even care?" Yeah, why do I? There's just no reason I should have to sort through these to keep them out of my systems, yet I don't want them there so no I have to, thanks apple... (this was before I got good on the terminal so it was actually quite annoying)
Bottom line: this still gets my blood boiling. Fuck apple, they're the new Microsoft in every way.
https://apple.stackexchange.com/questions/14980/why-are-dot-...
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool trueIt’s not a big deal.
The point is that yes, "my usb drives" get polluted the second I give them to an apple user even if they just read files off them.
Same happens if an apple user accesses a writable network share on my NAS or my PC.
I care, because I constantly have to be on the look-out then to not accidentally add them to tar files, backups etc.
When I navigate my own file collections I just don't want these things lying around my folders everywhere, distracting me for zero benefit.
That's all work and mind capacity that apple happily, without asking, offloads onto me, because they won't bother _their_ users with it and because wtf am I supposed to do, refuse to interact with all apple systems?
- There is anything to create a thumbnail cache for
- User has applied custom settings like a folder icon or designation to the folder
I remember hiding those from windows clients with samba, and hiding thumbs.db from mac clients over netatalk (and samba)
It looks like the finder "compress" functionality will include __MACOSX, and the command line zip doesn't.
If you run `xattr -l` on something in your Downloads, you should see the kMDItemWhereFroms metadata. mdls shows it too, but also includes other data that is extracted from the file itself.
You can also search on that metadata:
mdfind kMDItemWhereFroms:citeseerx> Zip files can encode their file names in two ways: CP437, or unicode.
> Each operating system does it wrong, but in a different way. For instance, Mac OS encodes its zip files as unicode, but doesn't set bit 11 correctly, so Python (correctly) reads them as CP437, and garbles the non-ASCII characters in file names.
> I wrote a quick and dirty workaround for Mac OS archives: if the file doesn't exist, encode the name as CP437 and check again. I'll think of something more clever if I ever switch to another OS.
#!/bin/bash
zipfile=$1
if [ "x$zipfile" = "x" ] ; then
echo "$0: .zip file expected" >&2
exit 1
fi
zip -d "${zipfile}" "__MACOSX*"
zip -d "${zipfile}" ".DS_Store"
zip -d "${zipfile}" "*/.DS_Store"
unzip -l "${zipfile}" | sort -k 5 if [ ! -f "$zipfile" ]
Instead of if [ "x$zipfile" = "x" ] #!/usr/bin/env bash
set -exuo pipefail
VERBOSE=false
while getopts "v" arg; do
case $arg in
v) VERBOSE=true;;
esac
done
shift $((OPTIND-1))
zipfile=$1
if [ ! -f "$zipfile" ] || [ ! "${zipfile##*.}" = "zip" ] ; then
echo "$0: .zip file expected" >&2
exit 1
fi
zip -d "${zipfile}" "__MACOSX*" ".DS_Store" "*/.DS_Store" "Thumbs.db" "*/Thumbs.db"
if [ $VERBOSE = true ]; then
unzip -l "${zipfile}" | sort -k 5
fi zip -d "${zipfile}" "__MACOSX*" ".DS_Store" "*/.DS_Store"This is easier to extend if I see something new to exclude (or comment-out some rule).
It's 2021. Hidden dot-files are not a new thing.
The Windows method, leveraging file attributes, is actually much cleaner in my opinion. You can set the hidden attribute in ZIP files and most tools do for OS specific files and folders, but I don't want my ZIP tool to put files on my file system that I don't get to see first so I always turn them on.
Windows does the same thing with desktop.ini, but I rarely encounter those anymore. It used to be that every ZIP had a bunch of thumbs.db files but Microsoft seems to have cut that out.
Yes, I am talking about .gitignore
.DS_Store - https://news.ycombinator.com/item?id=26435783 - March 2021 (30 comments)
Ask HN: What are the technical justifications for keeping .DS_Store? - https://news.ycombinator.com/item?id=23648165 - June 2020 (91 comments)
.DS_Store - https://news.ycombinator.com/item?id=20340151 - July 2019 (21 comments)
Don't commit your .DS_Store files - https://news.ycombinator.com/item?id=17134324 - May 2018 (2 comments)
.DS_Store files always hidden from Finder in macOS Sierra Beta - https://news.ycombinator.com/item?id=12056993 - July 2016 (11 comments)
.DS_Store for non-mac users - https://news.ycombinator.com/item?id=5733022 - May 2013 (15 comments)
Death to .DS_Store - https://news.ycombinator.com/item?id=3390509 - Dec 2011 (122 comments)
@dang, if you see this: Can you fix this for me? It's hard to be a part of the discussion here with this type of thing: "You're posting too fast. Please slow down. Thanks." (I can reply to email sent to the one in my profile for verification, I can't seem to originate emails from there, though, as it's a Fastmail "masked email".)
fat32 is very portable but has a 4GB limit and lacks entered attributes. exfat probably supports everything but until very recent open source drivers it lacked cross platform compatibility.
Plus too many devices are going to be limited to fat32 so we might as well just use that as a common denominator.
It would be nice if a DS_Store system could be used to associate split files (e.g. $NAME.1 $NAME.2, etc.) as a word around for the 4GB limit. User permission attributes and other extended attributes could be stored as well.
What's interesting is that Fat32 had this feature implemented on OS/2 and Win NT via files with the "␠EA.␠SF" suffix. Unfortunately looks like it was dropped in Windows 2000.
This is also when exFAT support was added to the Linux kernel.
(I also don’t see why anyone would implement the allocation-bitmap-based exFAT instead of the extent-based UDF. They haven’t even added a third FAT! ... But that’s an unrelated matter.)
Now? Well I/O performance is hardly a consideration for the latest Macs, but they’re there and they work, except the Mac OS X Finder 20 years later while far better than it’s debut performance is still a load of crap so it can still forget your custom view settings for a directory.
No love either for the twerp who invented desktop.ini or caused thumbs.db to seemingly keep coming back after I repeatedly turn off that feature.
If you're interested in such voodoo arts check out NTFS Alternate File Streams too (which while the bane of many at least have the decency not to spread to filesystems that don't support them).
It's also not something to get upset about - if .DS_Store or Apple double files (or for that matter Desktop.ini / thumbs.db) are a surprise then it's time to hang up one's coat, they're trivially revealed in the terminal and so predictable and easy to deal with that complaining about them is akin to holding up a dunce sign.
If one has purchased hardware/software that can't cope with them: get a refund, this shit is entry level basic.
I just can't comprehend the reasoning of hiding .DS_Store beyond the reach of viewing hidden files. This is user-hostile. Why don't the native zipping tools automatically ignore these files when creating an archive?
I know this because there's a bug in MacOS they refuse to fix where you can't restore files put into the recycle bin programmatically. This is because the API doesn't write the correct stuff to DS_Store.
Further, the format is proprietary, and I've even read that its structure changes depending on how it's used.
Frustrating crap.
Great, another feature I don’t want.
They do, however, create their own versions of the recycle bin/trash folder. If you use a flash drive on macOS, Windows and some Linux environments, you'll end up with three different recycle bin/trash folders. A bit annoying, but those folders are usually empty anyway.
Windows warns about the inability to copy permissions to FAT32 (in some cases, at least) and some command line tools on Linux do as well, but it depends on the tool.
Small correction then; "something non-mac users hate and non-mac users don't benefit from"
I doubt you'll ever hear a Mac user advocate for DS_Store files because by design they do their job best when you never realize they exist. I think for __some__ users once they realize icon positions are maintained there, they'll be a bit more defensive. For many users (myself included), since it can also control view settings for a given folder [0], that I would be pretty peeved to lose.
Computers create junk files all the time and carry a lot of bloat, and furthermore one person's bloat is another person's workflow.
No joke, back when I was still doing general helpdesk support we had some "sort of clever" users who found out that they could recover some project files from %appdata% and relied on this for "auto-saving" their projects. When a new fileserver was spun up and this time the admin forgot (decided not to?) to toggle redirection for Appdata, this user was in for a shock when we had no backup of their Appdata and they had lost months of work.
Personally DS_Store is a very minor annoyance at best, if even noticeable. For version control it's just another file to add to ignore lists, and for network shares it's a very simple MacOS command to disable writing them to network shares. But it's not fair to call it worthless, it has a lot of good uses if you're a Mac user.
Does anyone know how to prevent that from happening? It's a non-auth NFS, so anyone on the network is supposed to see and use it. So a server-side solution would be preferable, but client-side will do in a pinch.
There’s always been a hidden setting to stop Finder from generating these on a server, but the downside is that it won’t remember things like your girlfriend’s view preferences on the server (window position, sort options, text size, view type e.g. list or icon view).
That setting is also per user account, so if you have a user account for yourself on the same computer you would have to set it for yourself as well.
I wish the author explained in more technical detail or clearer how and where these files cause problems (not doubting that it does). In that case, it would have made a really useful article.
Resource forks are a filesystem feature (well forks are a filesystem feature and resource forks are an application of that feature). AppleDouble is a way of storing the information that would be in resource forks on filesystems that don't provide forks or similar functionality.