3 ms·
If I'm bringing up a directory listing, and the GUI tool I'm using is showing me different icons for different file types (or some other type-specific visual di
by DougWebb 12y ago
If I'm bringing up a directory listing, and the GUI tool I'm using is showing me different icons for different file types (or some other type-specific visual distinction), then I don't want it to have to read the first few bytes of every file in the directory. That doesn't scale. The file type needs to be part of the directory listing itself. Traditionally on Windows it's been part of the filename (which typically is only part of the directory listing, and not attached to the file) but it could have been stored as an attribute as well. That would have made more sense, but even NTFS was designed at a time when disk space actually cost something, and a filetype attribute probably would have wound up being a GUID registry key, which is a lot of bytes for every file in a big directory.
- lucb1e 12y agoFair point, and as you mention it could be optimized by using an attribute for magic mime cache. Another optimization is showing only the icons for the files currently in view, which should scale pretty much forever (I can't imagine so many files being in view that this becomes impractical without the view itself being useless). File managers already do this for thumbnails, though that's because they need to read the entire (often megabytes large) image.