Aller au contenu principal

.DS Store


.DS Store


In the macOS operating system, .DS_Store is a file that stores custom attributes of its containing folder, such as folder view options, icon positions, and other visual information. The name is an abbreviation of Desktop Services Store, reflecting its purpose. It is created and maintained by the Finder application in every folder, and has functions similar to the file desktop.ini in Microsoft Windows. Starting with a period . character, it is hidden in Finder and many Unix utilities. Its internal structure is proprietary, but has been reverse-engineered. Starting at macOS 10.12 16A238m, Finder will not display .DS_Store files (even with com.apple.finder AppleShowAllFiles YES set).

Purpose and location

The file .DS_Store is created in any directory (folder) accessed by the Finder application, even on remote file systems mounted from servers that share files (for example, via Server Message Block (SMB) protocol or the Apple Filing Protocol (AFP)). Remote file systems, however, could be excluded by operating system settings (such as permissions). Although primarily used by the Finder, these files were envisioned as a more general-purpose store of metadata about the display options of folders, such as icon positions and view settings. For example, on Mac OS X 10.4 "Tiger" and later, the ".DS_Store" files contain the Spotlight comments of the folder's files. These comments are also stored in the extended file attributes, but Finder does not read those.

In earlier Apple operating systems, Finder applications created similar files, but at the root of the volume being accessed, including on foreign file systems, collecting all settings for all files on the volume (instead of having separate files for each respective folder).

Problems

User complaints prompted Apple to publish means to disable the creation of these files on remotely mounted network file systems. Since macOS High Sierra (10.13), Apple delays the metadata gathering for .DS_Store for folders sorted alphanumerically to improve browsing speed. However, these instructions do not apply to local drives, including USB flash drives, although there are some workarounds. Before Mac OS X 10.5, .DS_Store files were visible on remote filesystems.

.DS_Store files may impose additional burdens on a revision control process, since they are frequently changed and can therefore appear in commits, unless specifically excluded.

.DS_Store files are included in archives, such as ZIP, created by OS X users, along with other hidden files and directories like the AppleDouble ._.

.DS_Store files have been known to adversely affect copy operations. If multiple files are selected for file transfer, the copy operation will retroactively cancel all progress upon reaching a (duplicate) .DS_Store file, forcing the user to restart the copy operation from the beginning.

Some Google Drive users on macOS reported that .DS_Store files were being flagged for copyright violations. Google stated that they had addressed an issue that "impacted a small number of Drive files" to try to prevent this issue from occurring.

See also

  • Windows thumbnail cache
  • Desktop.ini
  • AppleSingle and AppleDouble formats

References

External links

  • Binary format specification from Kaitai
  • A reverse-engineered description of the file format from Mozilla (Mark Mentovai)
    • A more detailed description of the file format (Perl documentation by Mark Mentovai and Wim Lewis)
    • Perl code to decode the .DS_Store format
  • A blog post walking through parsing the .DS_Store file format

Text submitted to CC-BY-SA license. Source: .DS Store by Wikipedia (Historical)