Main Site Documentation

SdCard problem


#1

When I try to read content of sd card, an exception is always throw (I’ve tried FAT and FAT32 but same error):

            _sdCardController = SdCardController.GetDefault();
            var drive = FileSystem.Mount(_sdCardController);
            _bMounted = true;
            _driveInfo = new DriveInfo(drive.Name);
            Debug.WriteLine(_driveInfo.TotalFreeSpace + "/" + _driveInfo.TotalSize);

            // Get root directory
            var rootDirectory = _driveInfo.RootDirectory;
           var dirs = rootDirectory.GetDirectories(); // This line always throws an exception

#2

What device?


#3

Sorry to forget this important information: FEZ Spider II (G120E), version of TinyClr 0.12.0 (of course because sd Card !)


#4

var dirs = rootDirectory.GetDirectories();

Confirm there is a bug with this function.


#5

@Dat_Tran Thanks for confirmation. Is there a workaround please ?


#6

Unfortunately, no workaround for now.

You may use the path directly till next release.


#7

@Dat_Tran It seems to be same problem with GetFiles() function.


#8

Just added to issue list. Thanks for help us to find out these bugs.