{"id":20094,"date":"2018-01-08T15:36:13","date_gmt":"2018-01-08T20:36:13","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=20094"},"modified":"2020-03-27T16:47:04","modified_gmt":"2020-03-27T20:47:04","slug":"icloud-drive-can-strip-metadata-from-your-documents","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2018\/01\/08\/icloud-drive-can-strip-metadata-from-your-documents\/","title":{"rendered":"iCloud Drive Can Strip Metadata From Your Documents"},"content":{"rendered":"<p><a href=\"https:\/\/developer.apple.com\/library\/content\/documentation\/FileManagement\/Conceptual\/FileSystemProgrammingGuide\/FileSystemOverview\/FileSystemOverview.html\">Apple<\/a>:<\/p>\n<blockquote cite=\"https:\/\/developer.apple.com\/library\/content\/documentation\/FileManagement\/Conceptual\/FileSystemProgrammingGuide\/FileSystemOverview\/FileSystemOverview.html\">\n<p>Apps create files and directories in iCloud container directories in exactly the same way as they create local files and directories. And all the file&rsquo;s attributes are saved, if they add extended attributes to a file, those attributes are copied to iCloud and to the user&rsquo;s other devices too.<\/p>\n<\/blockquote>\n\n<p><a href=\"https:\/\/eclecticlight.co\/2018\/01\/06\/icloud-drive-can-strip-metadata-from-your-documents\/\">Howard Oakley<\/a>:<\/p>\n<blockquote cite=\"https:\/\/eclecticlight.co\/2018\/01\/06\/icloud-drive-can-strip-metadata-from-your-documents\/\">\n<p>I have examined files with a rich collection of extended attributes, under 10.12.6 and 10.13.2, on local storage and in iCloud Drive. This confirms that most xattrs are stripped by iCloud Drive in this fashion.<\/p>\n<p>Xattrs removed include:<\/p>\n<ul>\n<li>com.apple.FinderInfo<\/li>\n<li>com.apple.metadata:_kMDItemUserTags<\/li>\n<li>com.apple.ResourceFork<\/li>\n<li>com.apple.serverdocs.markup<\/li>\n<li>net_sourceforge_skim-app_ series<\/li>\n<li>net_sourceforge_skim-app_notes<\/li>\n<li>net_sourceforge_skim-app_rtf_notes<\/li>\n<li>net_sourceforge_skim-app_text_notes<\/li>\n<li>co.eclecticlight.[any]<\/li>\n<\/ul>\n<p>[&#8230;]<\/p>\n<p>Xattrs which are preserved include:<\/p>\n<ul>\n<li>com.apple.TextEncoding<\/li>\n<li>com.apple.metadata:kMDItemDownloadedDate<\/li>\n<li>com.apple.metadata:kMDItemWhereFroms<\/li>\n<li>com.apple.metadata:kMDLabel_ series<\/li>\n<li>com.apple.quarantine<\/li>\n<\/ul>\n<\/blockquote>\n\n<p><a href=\"https:\/\/c-command.com\/eaglefiler\/help\/how-can-i-access-my-lib\">For me<\/a>, iCloud Drive preserves tags, but labels, resource forks, and any third-party extended attributes have always been lost. I don&rsquo;t understand why Apple&rsquo;s documentation claims otherwise.<\/p>\n\n<p>Previously: <a href=\"https:\/\/mjtsai.com\/blog\/2010\/12\/17\/dropbox-1-0\/\">Dropbox 1.0<\/a>.<\/p>\n\n<p>Update (2018-01-09): See also: <a href=\"https:\/\/news.ycombinator.com\/item?id=16101341\">Hacker News<\/a>.<\/p>\n\n<p>Update (2018-01-12): See also: <a href=\"https:\/\/eclecticlight.co\/2018\/01\/12\/which-file-systems-and-cloud-services-preserve-extended-attributes\/\">Howard Oakley<\/a>.<\/p>\n\n<p>Update (2018-01-29): <a href=\"https:\/\/eclecticlight.co\/2018\/01\/29\/icloud-drive-has-user-modes-and-tags-transferred-apps\/\">Howard Oakley<\/a>:<\/p>\n<blockquote cite=\"https:\/\/eclecticlight.co\/2018\/01\/29\/icloud-drive-has-user-modes-and-tags-transferred-apps\/\">\n<p>When you access your iCloud Drive from two or more client systems, iCloud Drive knows which files originated from each of the clients, and keeps track of that.<\/p>\n<p>[&#8230;]<\/p>\n<p>What is most startling is the way that it adds an apparently unique xattr of type <code>com.apple.cscachefs<\/code> to many files within application bundles. iCloud Drive doesn&rsquo;t appear to add quarantine flags (<code>com.apple.quarantine<\/code>), but adds <code>com.apple.cscachefs<\/code> instead &#x2013; only when accessed from a second client.<\/p>\n<p>[&#8230;]<\/p>\n<p>Some <code>com.apple.*<\/code> xattrs, like <code>com.apple.ResourceFork<\/code> and <code>com.apple.serverdocs.markup<\/code>, always get stripped; others will only be stripped if they exceed a certain size, which varies according to the type of xattr. All xattrs of 80 KB or larger are removed, but iCloud allows <code>com.apple.metadata:kMDItemCopyright<\/code>, for example, to reach 24 KB size and leaves it intact. If you rely on a particular xattr passing unscathed through iCloud&rsquo;s filters, you need to test it carefully over a range of sizes and situations.<\/p>\n<\/blockquote>\n\n<p id=\"icloud-drive-can-strip-metadata-from-your-documents-update-2020-03-27\">Update (2020-03-27): <a href=\"https:\/\/eclecticlight.co\/2020\/03\/18\/which-extended-attributes-does-icloud-preserve-and-which-get-stripped\/\">Howard Oakley<\/a>:<\/p>\n<blockquote cite=\"https:\/\/eclecticlight.co\/2020\/03\/18\/which-extended-attributes-does-icloud-preserve-and-which-get-stripped\/\">\n<p>However, when you access files which have been uploaded to iCloud from a different Mac or iOS device, iCloud doesn&rsquo;t preserve all xattrs by any means. Some are often but not always preserved, others usually stripped, and one type invariably stripped.<\/p>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Apple: Apps create files and directories in iCloud container directories in exactly the same way as they create local files and directories. And all the file&rsquo;s attributes are saved, if they add extended attributes to a file, those attributes are copied to iCloud and to the user&rsquo;s other devices too. Howard Oakley: I have examined [&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":"2019-12-19T19:58:10Z","apple_news_api_id":"bcc362b7-b09f-4269-b31a-890783c069b6","apple_news_api_modified_at":"2020-03-27T20:47:08Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAQ==","apple_news_api_share_url":"https:\/\/apple.news\/AvMNit7CfQmmzGokHg8Bptg","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":[2],"tags":[164,1902,16,913,31,1472,30,1381,1529,608,1613],"class_list":["post-20094","post","type-post","status-publish","format-standard","hentry","category-technology","tag-documentation","tag-extended-attributes","tag-icloud","tag-icloud-drive","tag-ios","tag-ios-11","tag-mac","tag-macos-10-12","tag-macos-10-13","tag-metadata","tag-skim"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/20094","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=20094"}],"version-history":[{"count":5,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/20094\/revisions"}],"predecessor-version":[{"id":28509,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/20094\/revisions\/28509"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=20094"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=20094"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=20094"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}