Problem using Directory.GetFiles(...)

R

romain taillandier

Hi group !

I simply use this code :

string[] CabFiles = Directory.GetFiles(@"\SomeDir");

foreach(string cab in CabFiles)
{
if(Path.GetExtension(cab).ToLower() != "cab")
continue;

// Do extract of the cab
}

In this directory i have an .exe file and 2 .cab files.
this code give me only 2 string in the CabFiles variable (instead of
3).
the first is the name of the .exe (no problem)
the second is : "\\SomeDir\\514c36bf-c13e-4091-a3a7-1e56627b20d"
my two cab files have readable name like MyModule.cab and MyProg.cab

I don't understand this problem. First i get 2 filenames instead of
three, then i get incorrect file name (seems like a guid).

any idea ?

thanks
ROM
 
R

romain taillandier

It happend on an acer N300.
Note that i have absolutely have no idea of what this guid (supposing
it is a guid) is corresponding to ...

File.Exists of these cab are returing true. the File explorer on
device or on PC (throw activesync) are showing the files. the cabs are
here !

I don't understand.

Now i have try to use Directory.GetDirectories to see if cab are
considered by the system as directory like for zip on Win XP, but this
is not the case.

OK, I have finally reboot the device, and now it is working correctly.

Thank you peter !

That's very unusual, what device is this occurring on?

Peter

--
Peter Foot
Device Application Development MVPwww.peterfoot.net|www.inthehand.com


Hi group !
I simply use this code :
string[] CabFiles = Directory.GetFiles(@"\SomeDir");
foreach(string cab in CabFiles)
{
if(Path.GetExtension(cab).ToLower() != "cab")
continue;
// Do extract of the cab
}
In this directory i have an .exe file and 2 .cab files.
this code give me only 2 string in the CabFiles variable (instead of
3).
the first is the name of the .exe (no problem)
the second is : "\\SomeDir\\514c36bf-c13e-4091-a3a7-1e56627b20d"
my two cab files have readable name like MyModule.cab and MyProg.cab
I don't understand this problem. First i get 2 filenames instead of
three, then i get incorrect file name (seems like a guid).
any idea ?
thanks
ROM
 

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