DirectoryInfo.GetFiles with 3-character extensions

R

Ray Mitchell

Hello,

I'm obviously missing the point, but the documentation on the GetFiles
method states that when a 3-character extension is supplied in the search
pattern it will match 3 or more characters. I've found this to be very
annoying and have often had to simply get a list of all files then manually
sift through them to locate those having exactly the 3-character extension
I'm looking for. Is there a way to turn off this "feature" in GetFiles so
that a 3-character extension means exactly a 3-character extension? Or maybe
I should be approaching this differently?

Thanks,
Ray
 
C

Cor Ligthert[MVP]

Peter,

I too spent some time on this, and I asked myself what is the reason for
this question.

Is it because that he wants to get all doc and docx files and that.

Then I remembered me all that went wrong with real audio files in past.
There were some with the name Rar as I remember it me well.

Therefore I replied in a question.

Maybe not the best thing, but I am born in area where that is often done to
give in fact an answer.

:)

Cor

Peter Duniho said:
[...]
And what about by instance .RA (real audio)

Cor,

I'm not sure what you're telling me.

I think he's asking if you have the same problem with (for example)
two-character extensions. I'm assuming the answer to that would be "no".
 
C

Cor Ligthert[MVP]

Peter,

I too spent some time on this, and I asked myself what is the reason for
this question.

Is it because that he wants to get all doc and docx files and that.

Then I remembered me all that went wrong with real audio files in past.
There were some with the name Rar as I remember it me well.

Therefore I replied in a question.

Maybe not the best thing, but I am born in area where that is often done to
give in fact an answer.

:)

Cor

Peter Duniho said:
[...]
And what about by instance .RA (real audio)

Cor,

I'm not sure what you're telling me.

I think he's asking if you have the same problem with (for example)
two-character extensions. I'm assuming the answer to that would be "no".
 
C

Cor Ligthert[MVP]

Peter,

Maybe I was missing the point, I was reading it that the pattern was 3 or
more characters.

For that I was replying.

Maybe wrong and should I have tested it, but because that is something
everybody can, I did not do.

Cor
 
C

Cor Ligthert[MVP]

Peter,

Maybe I was missing the point, I was reading it that the pattern was 3 or
more characters.

For that I was replying.

Maybe wrong and should I have tested it, but because that is something
everybody can, I did not do.

Cor
 

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

Top