Main Site Documentation

Is there a way of renaming the SD card after formatting?


#1

I used the following code to format my SD card if it has not been formatted already. After being formatted, the sdvolumeinfo.Format(“FAT”, 0) command names the card “MFDISK”. Is there a way of changing that name to something else? I’ve looked through Microsoft.SPOT.IO documentation without success.


public SDLogger()
        {
            try
            {
                // try to access the microSD
                sdPS = new PersistentStorage("SD");
                sdPS.MountFileSystem();
                
                // Format the media if it was not.
                VolumeInfo sdvolumeinfo = new VolumeInfo("SD");
                if (!sdvolumeinfo.IsFormatted)
                {
                    Debug.Print("Formatting SDCARD...");
                    sdvolumeinfo.Format("FAT", 0);  
                }
                sdvolumeinfo = null;
                Debug.Print("Card is formatted!");
                SDinit();

            }
            catch
            {
                // if failed, assume no card in slot
                cardLoaded = false;
            }
        }


#2

Is there an equivalent to the DriveInfo class that would enable a rename of an SD Card after having it formatted by the EMX module?

Here is the class:
http://msdn.microsoft.com/en-us/library/system.io.driveinfo.volumelabel.aspx

So far, i still am searching for a way to rename a freshly formatted SD Card.

Cheers,
Jean-Francois