Does searchPattern in GetDirectories not recognize case differences?

  • Thread starter Thread starter sherifffruitfly
  • Start date Start date
S

sherifffruitfly

I want to return all directories fitting the pattern "v*", but NOT
include anything that starts with a capital "V". How can I do this?

tia!
 
sherifffruitfly said:
I want to return all directories fitting the pattern "v*", but NOT
include anything that starts with a capital "V". How can I do this?

With Windows & NTFS then v.txt and V.txt is the same file, so would
it make sense to consider them different ?

Arne
 
I want to return all directories fitting the pattern "v*", but NOT
include anything that starts with a capital "V". How can I do this?

You'd have to do it explicitly, and frankly doing so wouldn't make much
sense, since the file system itself is case-insensitive. It stores case,
but you can't have two different files or directories that have names
differing only by case.

Pete
 
Arne said:
With Windows & NTFS then v.txt and V.txt is the same file, so would
it make sense to consider them different ?

If you really want it I guess you can get all files and make
your own case sensitive comparison.

Arne
 
You'd have to do it explicitly, and frankly doing so wouldn't make much
sense, since the file system itself is case-insensitive. It stores case,
but you can't have two different files or directories that have names
differing only by case.

Pete

Ah - I hadn't realized - they're displayed "cased" in Windows
Explorer.

Ok then - does searchPattern permit regex matching?


Thanks for pointing out the case insensitivity of directories/files
all!
 
[...]
Ok then - does searchPattern permit regex matching?

I'm reasonably sure it doesn't. It just supports, as far as I know, the
same pattern-matching available via the Windows shell.

Frankly, the search pattern parameter is really just a convenience
parameter. It would be trivial for you to write a custom method that
takes the full directory results and runs whatever search you want on it,
including some sort of Regex-based matching if that's what you want.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top