{"id":46417,"date":"2025-01-13T15:12:13","date_gmt":"2025-01-13T20:12:13","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=46417"},"modified":"2025-01-16T09:10:19","modified_gmt":"2025-01-16T14:10:19","slug":"what-happened-to-apfs-fast-directory-sizing","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2025\/01\/13\/what-happened-to-apfs-fast-directory-sizing\/","title":{"rendered":"What Happened to APFS Fast Directory Sizing?"},"content":{"rendered":"<p><a href=\"https:\/\/mastodon.social\/@siracusa\/113738396173109899\">John Siracusa<\/a>:<\/p>\n<blockquote cite=\"https:\/\/mastodon.social\/@siracusa\/113738396173109899\">\n<p>Has anyone successfully enabled Fast Directory Sizing on a directory on an APFS volume in macOS and then confirmed that it works using <code><a href=\"https:\/\/github.com\/apple-oss-distributions\/Libc\/blob\/af11da5ca9d527ea2f48bb7efbd0f0f2a4ea4812\/libdarwin\/h\/dirstat.h#L48\">dirstat_np<\/a><\/code>?<\/p>\n<\/blockquote>\n\n<p><a href=\"https:\/\/techhub.social\/@jimluther\/113736709765578340\">Jim Luther<\/a>:<\/p>\n<blockquote cite=\"https:\/\/techhub.social\/@jimluther\/113736709765578340\"><p>That&rsquo;s one of those promised features I was referring to that never really was hooked up or implemented right. IIRC, the problems with it are:<\/p><ul><li>You have to create the directory and set an attribute on it before putting anything in it. It&rsquo;s not available on already existing directories.<\/li><li>The size returned only includes the files data fork space. Extended attributes (including the resource fork) are not included.<\/li><li>The API is synchronous with no progress callbacks.<\/li><\/ul><p>Those reasons keep the Finder from using it, and the Finder team asked for that APFS feature.<\/p><\/blockquote>\n\n<p><a href=\"https:\/\/mastodon.social\/@jimmyjamesuk\/113739256091916346\">James Atkinson<\/a>:<\/p>\n<blockquote cite=\"https:\/\/mastodon.social\/@jimmyjamesuk\/113739256091916346\">\n<p>Is it a limitation of APFS that this feature couldn&rsquo;t be created in a way that was useful to the Finder team, or is it just not a priority perhaps? I do find APFS fascinating. Also curious why the delta snapshot sending that was demoed never amounted to anything?<\/p>\n<\/blockquote>\n\n<p>And <a href=\"https:\/\/techhub.social\/@jimluther\/113739903686910327\">Radar 32794924<\/a> apparently says that, if even you&rsquo;re OK with those limitations, the <code>DIRSTAT_FAST_ONLY<\/code> path currently doesn&rsquo;t work, so the API can only do the <code>DIRSTAT_FORCE_FALLBACK<\/code> path of recursively calculating all the sizes.<\/p>\n\n<p>Previously:<\/p>\n<ul>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2018\/11\/19\/apfs-in-2018\/\">APFS in 2018<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2018\/09\/21\/apple-file-system-reference\/\">Apple File System Reference<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2017\/07\/12\/pondering-the-conversion-from-hfs-to-apfs\/\">Pondering the Conversion From HFS+ to APFS<\/a><\/li>\n<li><a href=\"https:\/\/mjtsai.com\/blog\/2016\/06\/17\/apple-file-system-apfs\/\">Apple File System (APFS)<\/a><\/li>\n<\/ul>\n\n<p id=\"what-happened-to-apfs-fast-directory-sizing-update-2025-01-16\">Update (2025-01-16): <a href=\"https:\/\/x.com\/XNUniverse\/status\/1878936346284425669\">Kory Heard<\/a>:<\/p>\n<blockquote cite=\"https:\/\/x.com\/XNUniverse\/status\/1878936346284425669\">\n<p>Apple strongly hinted that APFS would be open sourced when first announced but that never came.<\/p>\n<\/blockquote>\n<p>See also: <a href=\"https:\/\/news.ycombinator.com\/item?id=18332978\">Hacker News<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>John Siracusa: Has anyone successfully enabled Fast Directory Sizing on a directory on an APFS volume in macOS and then confirmed that it works using dirstat_np? Jim Luther: That&rsquo;s one of those promised features I was referring to that never really was hooked up or implemented right. IIRC, the problems with it are:You have to [&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-01-13T20:12:16Z","apple_news_api_id":"adbe7ea3-8832-4973-8910-adbc5b5fe4dc","apple_news_api_modified_at":"2025-01-16T14:10:22Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/Arb5-o4gySXOJEK28W1_k3A","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":[1395,1902,537,458,30,2598,74,71],"class_list":["post-46417","post","type-post","status-publish","format-standard","hentry","category-technology","tag-apple-file-system-apfs","tag-extended-attributes","tag-filesystem","tag-finder","tag-mac","tag-macos-15-sequoia","tag-opensource","tag-programming"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/46417","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=46417"}],"version-history":[{"count":2,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/46417\/revisions"}],"predecessor-version":[{"id":46454,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/46417\/revisions\/46454"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=46417"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=46417"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=46417"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}