- 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" ] 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).
#!/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
fiIt'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