At least on Windows, as far as I know, the casing of a file extension doesn't
come into play. But when comparing extensions, you have to be careful to
lowercase the result of `getExt()`, for example:
foreach (string name; dirEntries(curdir, SpanMode.shallow))
{
if (name.isFile name.getExt
On 4/1/11, Andrej Mitrovic n...@none.none wrote:
I often have to search for files that have a certain extension. Having to
expand the code to the following becomes ugly real fast:
foreach (string name; dirEntries(curdir, SpanMode.shallow))
{
if (name.isFile name.hasExt.tolower == ini ||
On 04/01/2011 11:03 PM, Andrej Mitrovic wrote:
At least on Windows, as far as I know, the casing of a file extension doesn't
come into play. But when comparing extensions, you have to be careful to
lowercase the result of `getExt()`, for example:
foreach (string name; dirEntries(curdir,
Match a single extension or any number of extensions. I've said
range, but I didn't mean a custom type. Just that it works with
either 1 value or an array of values.