Hello. I have a windows program, that uses native windows directory enumeration to build the list of it's plugins. Each plugin is located in a separate directory. I need my plugin to be the first one loaded, so under windows i name the folder like "!mysuperplugin" and the job is done, the exclamation mark makes it the top folder in both explorer and, apparently, internal listings, but when i launch this program in Linux under wine from EXT-family volumes, the loading order is entirely different, the trick doesn't work anymore and plugins are broken.
Is there some tricky naming conventions i can use for my plugin that will work both under Wine and Windows or at least only under Wine (creating a separate package is not an issue for me)?
Tricking directory enumeration under wine
-
- Level 7
- Posts: 823
- Joined: Thu Aug 27, 2009 6:23 am
Re: Tricking directory enumeration under wine
Did you try something obvious like naming the folders "1myplugin", "2myplugin" and so on? Sorting on 'special' characters like "!" doesn't sound like a good idea anyway.
Does your application explicitly sort the files? Probably not. Maybe your application uses some undocumented behaviour in Windows, e.g. a function that always returns an ordered list of files/folders. Or maybe some function in wine hasn't yet been properly implemented. In either case you should file a bug and maybe provide a simple test case.
Does your application explicitly sort the files? Probably not. Maybe your application uses some undocumented behaviour in Windows, e.g. a function that always returns an ordered list of files/folders. Or maybe some function in wine hasn't yet been properly implemented. In either case you should file a bug and maybe provide a simple test case.
Re: Tricking directory enumeration under wine
From what i understood, it does it's enumeration in alphabetical order, identical to windows command-line's "DIR" output. Folders prefixed with exclamation marks always come on top. On Linux it definitely ignores my exclamation marks and puts it lower in the hierarchy. If there is no other way to cement my position above everything with conventional special characters, i'll try using combined exclamation and numbers then, because there are other plugins on windows starting with "!" and i most definitely will need to be above them. Thanks for your help, i wish i knew the exact technical details about the enumeration to file a bug report. What i have right now is just two different outcomes for rather undocumented very specific, "hacky" interactions and it probably will be rejected.
-
- Level 2
- Posts: 23
- Joined: Sun Mar 13, 2016 11:15 am
Re: Tricking directory enumeration under wine
This is a known problem in Wine. When using NTFS as filesystem, the files are returned in alphabetical order while other filesystems like EXT sort files in a different way. More information can be found at https://bugs.winehq.org/show_bug.cgi?id=34122. You might want to subscribe to this bug report to get more information about possible fixes or workarounds.
Re: Tricking directory enumeration under wine
It's a quirk on Windows that NTFS filesystems are sorted alphabetically by the FindFirstFile/FindNextFile methods. Actually Wine does not emulate this "non-standard" behaviour by default...
I'm successfully using this patch from Wine bug 34122 as a Gentoo user patch for my wine install... It works like a charm - but the case insensitivity flag needs to be set to TRUE - as per my comment (25) on the bug...
I'm successfully using this patch from Wine bug 34122 as a Gentoo user patch for my wine install... It works like a charm - but the case insensitivity flag needs to be set to TRUE - as per my comment (25) on the bug...