Hi,
Just a quick question asking if there is a more elegant way to detect if a file exists on an SD card.
bool FileExists(string filePath)
{
bool exists = false;
try
{
FileStream dummy=storageDev.OpenRead(filePath);
exists=true;
}
catch (IOException e)
{
if (e.ErrorCode == IOException.IOExceptionErrorCode.FileNotFound)
{
exists = false;
}
else
{
FatalError(e.Message);
}
}
return exists;
}
Cheers,
Jas