3 ms·
If there are multiple files in a wildcard pattern, what order are they resolved? I know for classpath loading, for example, it’s in directory order, which is fi
by jonhohle 3y ago
If there are multiple files in a wildcard pattern, what order are they resolved? I know for classpath loading, for example, it’s in directory order, which is file system dependent, and often based on the order the files were written to the directory and/or the size of the directory inode. Lots of fun figuring out why the wrong version of a class is consistently loaded on one or two servers out of twenty. (Always check your classpaths for duplicates kids.)
- cesarb 3y ago> Always check your classpaths for duplicates kids. I recently discovered extra-enforcer-rules which can help with that, as long as your classpath comes from Maven dependencies.
- ycombobreaker 3y agoI've always seen this solved by sorting (lexicographical order of bytes, originally). First two characters were digits, for all files within a wildcard directory.
- justsomehnguy 3y ago> If there are multiple files in a wildcard pattern, what order are they resolved If you don't care (eg [0]) then do nothing and let the user bang it's head and reinvent the wheel. If you care - just sort it and mark it as 'platform dependent' or somehow. Nobody really cares for the exact rules and a simple \d\d\-\w+\.conf pattern for the filenames is more than enough in 99% of cases. [0] https://www.zabbix.com/documentation/6.0/en/manual/appendix/config/special_notes_include https://www.zabbix.com/documentation/6.0/en/manual/appendix/...
- usrusr 3y agoOh yes! Good thing if it only happens in the build server and not on deployments, but that can be "fun" enough. Bonus points if you have a culture of repeat builds being "special".