On 18/10/19 9:27 AM, Eryk Sun wrote:
On 10/17/19, MRAB <pyt...@mrabarnett.plus.com> wrote:
On 2019-10-17 20:06, Eryk Sun wrote:

I'm bugged by how the article mis-characterizes the fundamental
problem. The operating system has nothing to do with the order of a
directory listing, which varies even with an OS, depending on the file
system. The latter could store each entry in a tree structure that's
sorted by filename, or it could use a mapping with hash values, or it
could simply use the first available slot in a list, based on the
order of past create and delete operations.

"The operating system has nothing to do with the order of a directory
listing"?

Well, that depends on the operating system. It might guarantee the order.

That would be typically provide no benefit and be an unnecessary
expense in the kernel, especially for directories that contain
thousands of entries, considering applications typically need a
particular sort order anyway. Also, while such a system could make
this default order cheap for its own platform-restricted file systems,
supporting other file systems such as NTFS and ext3 would bear the
cost of having to dynamically sort directory listings instead of just
listing the entries as they're naturally stored in the file-system
data structures.


To be fair to the original developers, not many people develop with multiple platforms in-mind. Perhaps more *nix devs do think 'platform' because the user-community may be MS-Win-based...

When building an application, if it works for you, that's great. If others then want to use it, there is an amount of "caveat emptor" - particularly when jumping platforms.

With the gift of hind-sight, some ideas may seem weak, even reprehensible; but they worked at the time. Just this morning I was reading about 'legal' Linux file/path syntax, and saw an article which recounted that Bourne (as in -Shell) had a series of files - one for each of the legal characters, which could be used as some sort of lookup. Are there easier ways once RAM has become cheap(er)?
NB have no idea of the veracity of this claim.

I've been working on a consolidation of personal file/dir-manipulation utilities (as many 'here' know, and have kindly guided/assisted) but have not given any thought to non-Posix systems at all (contrary to the aims of importlib, for example). If someone takes *my* code and tries to run it on MS-Win Python, they'll soon find-out! That said, I'm not expecting to publish any results with the expectation of world-domination...
--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to