{"id":50501,"date":"2025-12-18T15:47:46","date_gmt":"2025-12-18T20:47:46","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=50501"},"modified":"2026-04-27T11:34:41","modified_gmt":"2026-04-27T15:34:41","slug":"extended-attributes-flags-in-tahoe","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2025\/12\/18\/extended-attributes-flags-in-tahoe\/","title":{"rendered":"Extended Attributes Flags in Tahoe"},"content":{"rendered":"<p><a href=\"https:\/\/eclecticlight.co\/2025\/12\/17\/which-extended-attributes-does-macos-tahoe-preserve\/\">Howard Oakley<\/a>:<\/p>\n<blockquote cite=\"https:\/\/eclecticlight.co\/2025\/12\/17\/which-extended-attributes-does-macos-tahoe-preserve\/\">\n<p>When first introduced in Mac OS X, no provision was made for xattrs to have type-specific preservation, and that was added later using flags suffixed to the xattr&rsquo;s name. For example, the com.apple.lastuseddate xattr found commonly on edited files is shown with a full name of com.apple.lastuseddate#PS to assign the two flags P and S to it, and the most recent xattr com.apple.fileprovider.pinned, used to mark files in iCloud Drive that have been pinned, has the two flags P and X assigned to it for a the full name of com.apple.fileprovider.pinned#PX.<\/p>\n<p>[&#8230;]<\/p>\n<p>It&rsquo;s further complicated by a set of system tables for some standard xattr types that don&rsquo;t have flags suffixed, but are treated as if they do.<\/p>\n<p>[&#8230;]<\/p>\n<p>When using standard commands such as <code>cp<\/code>, macOS will automatically apply these rules when deciding whether to preserve xattrs. However, using a command for a different intent, such as <code>cp<\/code> for backing up, won&rsquo;t normally invoke the behaviour you might want.<\/p>\n<p>Code using standard macOS file operations should follow the behaviour expected for its intent, and shouldn&rsquo;t require any special handling of xattrs. Lower-level operations are likely to differ, though, and may require implementation of equivalent behaviours.<\/p>\n<\/blockquote>\n<p>The <code>xattr_intent_with_flags()<\/code> function will tell you, given an intent and a set of flags, whether you should preserve the xattr.<\/p>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2023\/07\/31\/icloud-drive-troubleshooting-metadata-and-custom-icons\/\">iCloud Drive Troubleshooting, Metadata, and Custom Icons<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2019\/08\/02\/excluding-from-icloud-drive\/\">Excluding From iCloud Drive<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2019\/07\/23\/xattr-flags-and-icloud-drive\/\">xattr Flags and iCloud Drive<\/a><\/li>\n<\/ul>\n\n<p id=\"extended-attributes-flags-in-tahoe-update-2026-04-27\">Update (<a href=\"#extended-attributes-flags-in-tahoe-update-2026-04-27\">2026-04-27<\/a>): See also: <a href=\"https:\/\/eclecticlight.co\/2026\/04\/24\/the-secret-life-of-the-xattr\/\">Howard Oakley<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Howard Oakley: When first introduced in Mac OS X, no provision was made for xattrs to have type-specific preservation, and that was added later using flags suffixed to the xattr&rsquo;s name. For example, the com.apple.lastuseddate xattr found commonly on edited files is shown with a full name of com.apple.lastuseddate#PS to assign the two flags P [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2025-12-18T20:47:52Z","apple_news_api_id":"17e8674d-6e6b-4e86-baa6-eebb547bd9eb","apple_news_api_modified_at":"2026-04-27T15:34:44Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/AF-hnTW5rToa6pu67VHvZ6w","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[1902,913,30,2742,608,71],"class_list":["post-50501","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-extended-attributes","tag-icloud-drive","tag-mac","tag-macos-tahoe-26","tag-metadata","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/50501","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=50501"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/50501\/revisions"}],"predecessor-version":[{"id":51718,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/50501\/revisions\/51718"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=50501"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=50501"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=50501"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}