UPDATE : This issue doesn't appear on Android devices I've tested. It returns good values. Would really appreciate any pointers on this matter.
I am having trouble getting the correct AvailableFreeSpace values from my Mac desktop computer. I am working with Unity3D C#, and am using the following code :
DriveInfo[] drives = DriveInfo.GetDrives();
foreach(DriveInfo drive in drives)
{
if (drive.IsReady)
{
Debug.Log(drive.Name);
Debug.Log(drive.AvailableFreeSpace);
Debug.Log(drive.TotalFreeSpace);
Debug.Log(drive.TotalSize);
}
}
My results are a bit weird. I'm only getting one drive : The name I'm getting is "/", and ythe values are wrong. AvailableFreeSpace returns a higher value than TotalSize, which makes no sense. Also, the DriveType is Unknown and the drive Format is unixfs, if that helps.
Don't know if I'm missing something obvious about the file structure on a Mac computer, maybe?
EDIT : I have a SATA HDD with 500go divided into two partitions. Shouldn't it give me 2 drives?
EDIT2 : My Monodevelop version is 4.0.1, so I don't think this is related to the bug reported years ago on version 2.10.0 or something like that.
What am I doing wrong?