{"id":27490,"date":"2019-12-03T16:55:59","date_gmt":"2019-12-03T21:55:59","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=27490"},"modified":"2020-07-03T16:47:04","modified_gmt":"2020-07-03T20:47:04","slug":"reading-the-resource-fork-too-often","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2019\/12\/03\/reading-the-resource-fork-too-often\/","title":{"rendered":"Reading the Resource Fork Too Often"},"content":{"rendered":"<p><a href=\"https:\/\/forum.latenightsw.com\/t\/alert-cannot-save-document-error-on-catalina-systems\/2203\">Mark Alldritt<\/a>:<\/p>\n<blockquote cite=\"https:\/\/forum.latenightsw.com\/t\/alert-cannot-save-document-error-on-catalina-systems\/2203\">\n<p>This problem happens after a document has been opened in Script Debugger and changes have been saved a number of times.  If the saves are done in fairly quick succession, Script Debugger will begin reporting that it cannot save document changes.  In some instances, errors -54 (<code>permErr<\/code>) or -43 (<code>fnfErr<\/code>) are reported.  Additionally, once this situation arises and you close the document, it is no longer possible to open the effected document in Script Debugger.<\/p>\n<p>[&#8230;]<\/p>\n<p>At a technical level, the problem is triggered when applications attempt to read the resource fork of a document repeatedly within a given period of time. This behaviour by an application seems to trigger a security mechanism within Catalina that prevents further access to the document&rsquo;s resource fork (the resource fork is used to retain meta-data in text and compiled AppleScript documents).<\/p>\n<\/blockquote>\n\n<p>You&rsquo;d think that old deprecated stuff like resource forks would just keep working in its frozen state. But both Mojave and Catalina introduced resource bugs that have hit my apps. There are more modern replacements for many uses of the resource fork, but they don&rsquo;t always work. And, as with the AppleScript example, sometimes the resource fork is unavoidable, and the problems even hit Apple&rsquo;s own apps.<\/p>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2019\/07\/23\/annoying-catalina-security-features\/\">Annoying Catalina Security Features<\/a><\/li>\n<\/ul>\n\n<p id=\"reading-the-resource-fork-too-often-update-2019-12-12\">Update (2019-12-12): <a href=\"https:\/\/eclecticlight.co\/2019\/12\/10\/stick-a-fork-in-it-and-other-flashbacks\/\">Howard Oakley<\/a>:<\/p>\n<blockquote cite=\"https:\/\/eclecticlight.co\/2019\/12\/10\/stick-a-fork-in-it-and-other-flashbacks\/\">\n<p>With Shane Stanley&rsquo;s help, I&rsquo;ve been able to reproduce this problem and to examine an excerpt of the log detailing what happened on that occasion. In this case, trying to access a resource fork in an AppleScript .scpt file which had just been repeatedly edited using Apple&rsquo;s Script Editor triggered a request to the Catalina privacy system (TCC), which required the requesting app to have been granted a <code>kTCCServiceSystemPolicyAllFiles<\/code> entitlement.<\/p>\n<p>[&#8230;]<\/p>\n<p>One way to avoid that particular error is to add apps which need access to resource forks, like Script Debugger and Script Editor, to the <strong>Full Disk Access<\/strong> list in the <strong>Privacy<\/strong> tab of the <strong>Security &amp; Privacy<\/strong> pane.<\/p>\n<\/blockquote>\n\n<p><a href=\"https:\/\/twitter.com\/steipete\/status\/1202219939186331649\">Peter Steinberger<\/a>:<\/p>\n<blockquote cite=\"https:\/\/twitter.com\/steipete\/status\/1202219939186331649\">\n<p>&#x201E;After macOS 10.10, our users reported weird new crashers. As if the lock method in <code>NSPersistentStoreCoordinator<\/code> didn&rsquo;t do anything anymore. Let&rsquo;s look into Hopper... oh. [the lock was gone, method just was a NOP]<\/p>\n<\/blockquote>\n\n<p>It&rsquo;s not safe to rely on deprecated methods.<\/p>","protected":false},"excerpt":{"rendered":"<p>Mark Alldritt: This problem happens after a document has been opened in Script Debugger and changes have been saved a number of times. If the saves are done in fairly quick succession, Script Debugger will begin reporting that it cannot save document changes. In some instances, errors -54 (permErr) or -43 (fnfErr) are reported. Additionally, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2019-12-03T21:56:05Z","apple_news_api_id":"5d8446a1-3d3b-4d8a-bbca-244d96888f33","apple_news_api_modified_at":"2020-07-03T20:47:07Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAQ==","apple_news_api_share_url":"https:\/\/apple.news\/AXYRGoT07TYq7yiRNloiPMw","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":[159,131,371,30,1609,1666,71,759,1073,48,1960],"class_list":["post-27490","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-applescript","tag-bug","tag-dropdmg","tag-mac","tag-macos-10-14","tag-macos-10-15","tag-programming","tag-resource-fork","tag-script-debugger","tag-security","tag-transparency-consent-and-control-tcc"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/27490","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=27490"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/27490\/revisions"}],"predecessor-version":[{"id":27541,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/27490\/revisions\/27541"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=27490"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=27490"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=27490"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}