Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Jolly Roger Newsgroups: comp.sys.mac.system Subject: Re: APFS on HDD Date: 2 Oct 2017 03:07:49 GMT Organization: People for the Ethical Treatment of Pirates Lines: 41 Message-ID: References: <1nd7pub.1p1k0xux560thN%nmassello@yahoo.com> <59d15fb2$0$29825$b1db1813$e2fc663e@news.astraweb.com> <1nd9lgd.1cknrg6116x4c3N%dempson@actrix.gen.nz> <011020172110504375%nospam@nospam.invalid> X-Trace: individual.net 2QN4RFM5hAha1bGZucqT+gn6uoeKayCTwRHkrfUOs7bqKUFG5n Cancel-Lock: sha1:4yAAuEdyFsgATp9z7RghM0bXNOw= Mail-Copies-To: nobody User-Agent: slrn/1.0.1 (Darwin) Xref: csiph.com comp.sys.mac.system:109290 On 2017-10-02, nospam wrote: > In article <1nd9lgd.1cknrg6116x4c3N%dempson@actrix.gen.nz>, David > Empson wrote: > >> One possible reason for APFS compatibility problems in an application >> which only uses high level APIs is if the application is assuming >> behaviour of certain calls based on how they behave for HFS+. >> >> A prime example is the readdir() C library function which is used to >> iterate through a directory. >> >> On an APFS volume it returns directory entries in a hash order, >> because that is the order APFS uses for its directories. >> >> An application which has only been tested on HFS+ volumes may be >> making a false assumption that readdir() returns a sorted list of >> filenames. It does not specify the output order. >> >> With hashed output on APFS this could result in problems like an >> application trying to process a directory thinking that a previously >> located file is missing, because it doesn't appear before one which >> it expects to have come later in the assumed sort order. >> >> This could be particularly nasty for things like directory sync >> utilities because they could try to sync an apparent deletion, when >> the file is actually still there, just later in the list. > > apple has long said never to rely on the order of file enumeration. > > it's also a bad idea for other file systems too. Indeed, it seems to be a bad idea just about anywhere. I've never assumed the order of any file system enumeration without first running it through a sort algorithm to ensure it is sorted the way my software expects - even back in the days of DOS and classic macOS. -- E-mail sent to this address may be devoured by my ravenous SPAM filter. I often ignore posts from Google. Use a real news client instead. JR