We're working with a webdav server that interacts with Mac Finder. We've noticed that at least half of the requests that Finder makes when copying files and folders to the server involve several extra files:

  • A .DS_Store file for each folder
  • A ._filename resource fork for each file to be copied (including one for the .DS_Store)
  • A .random-string-Spotlight file

I've noticed that if I return a 403 (Forbidden) response each time Finder tries to upload one of those files Finder won't complain, and the performance is greatly increased (more than 50%).

Now my questions are, how safe it is to just ignore those files? What kind of information I might be missing? What file formats will be rendered useless? etc.

Additionally, any other suggestion on how to improve the performance of this interaction is appreciated.

Thanks

有帮助吗?

解决方案

Blocking .DS_Store files (and ._.DS_Store) is safe -- they contain information from the Finder about how a folder was displayed (icon vs. list vs. column view, icon positions, etc). Blocking other ._ files are only mostly safe. They store filesystem metadata about the files, including resource forks (if files have them, but it most don't), Finder tags, quarantine info, ... lots of things. In most cases, this metadata is unimportant, so blocking them is mostly safe.

But there are a few cases where this info is important; the most obvious is Finder alias files, which break completely without the metadata (in this case, it's actually type and creator codes that're critical). The simplest rule is that if a non-Mac computer (Windows, unix, linux, etc) could use the file, killing the metadata should be safe. But if you're using any Mac-only stuff (e.g. Finder aliases), it might not be.

其他提示

It's pretty much completely safe to ignore them. They are used internally by OS X, and personally as a developer I quite often exclude these files in source code or otherwise.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top