Main Site Documentation

GetFiles bug


#1

While on the topic of file system. I think I tripped over a bug.

So issuing the following on an “SD” volume:
Directory.GetFiles(“MM”);

Will *create the directory MM, instead of getting an IO error as one would expect. Not sure if NetMF bug, Fez bug, or a confluence of the two.


#2

It is throwing exceptions here. Please make a small program that generates the problem.


#3

Hi Mike. Test here on my domino creates dir. Dump is just extention method to Debug.Print elements. http://www.fezzer.com/project/216/dump-collections/

public static void GetFiles()
{
    // Delete if exists already.
    Directory.Delete(@ "\SD\MM");

    // Print Dirs before.
    string[] dirs = Directory.GetDirectories(@ "\SD");
    dirs.Dump("\nDirs Before:");

    // Creates Dir \SD\MM
    string[] files = Directory.GetFiles(@ "\SD\MM");
    Debug.Print("\nFiles count:" + files.Length);

    // Print Dirs after.
    dirs = Directory.GetDirectories(@ "\SD");
    dirs.Dump("\nDirs after:");

    /* Output:
    Dirs Before:
    \SD\WJS

    Files count:0

    Dirs after:
    \SD\WJS
    \SD\MM
    */
}

#4

Thank you. We opened an issue for NETMF code. For now, you can check if the directory exists before getting the files…


#5

Thanks Mike. So you confirmed it was NETMF issue? I was not sure if it was SD driver, fez persis storage, or netmf.


#6

It is something inside the file system itself. We are investigating…


#7

I guess one quick way to Half the problem space is try the code on non-fez MF hardware to see if repro. If can repro, then issue probably just in netmf. I don’t have any non-fez hw - which I guess is a good thing. :slight_smile:


#8

It is very unlikely to be specific to GHI’s products. The problem is in the file system which is NETMF. It is easy to check if the folder exists before enumerating what’s inside it for now.