http://bugs.winehq.org/show_bug.cgi?id=3817
------- Additional Comments From scott@open-vote.org 2007-12-03 03:11 ------- 1st comment:
The bug pretty clearly shows a specific case of showing nonexistence of a case-insensitive name on a case sensitive filesystem, which isn't exactly a string comparison like I talked about before (in-memory comparison). The problem is higher level than the one that call would help out with. Personally, I would have written the operation as a lookup on a trie generated for each directory's file listings. I specifically say trie because so, so many people just dump shit into a hash table and don't give a rip about memory use.
I'm not precisely sure how the vfat / fat32 driver handles existence of case-insensitive filenames, but I'd recommend looking at that for a solution from those who have put more than 2 minutes thinking about the issue. From what I can tell in the posts, the existing method is really, really inefficient for large numbers of files (and even worse for longer filename inputs).
I think it wouldn't be a problem to add some code to Wine itself to cache filenames it encounters on a path internally - not necessarily as a kernel extension for userspace. Another option as a stopgap solution is to write something for FUSE to cover the case insensitivity problem at the filesystem level and have Wine wrap around the local filesystem via FUSE. I dunno how lightweight FUSE is, but it may be worth a shot.