0

i have this functions for get available free space on device.

public static Boolean IsAvailableFreeSpace(long size)
    {
        long availableFreeSpace = (long)0;
        using (IsolatedStorageFile userStoreForApplication = IsolatedStorageFile.GetUserStoreForApplication())
        {
            availableFreeSpace = userStoreForApplication.AvailableFreeSpace;
        }
        return ((long) availableFreeSpace < (long)size) ? false : true;
    }

in a main of my project i have a "global" variable boolean and I'll see if I have more than 10 MB(52428800 byte)

  Booelan AvailableFreeSpace = IsAvaiabileFreeSpace(52428800); 

in a particular device users have a 10/12GB free space and my function returns FALSE!! Why?

John Brush
  • 177
  • 11
  • What is the value of `userStoreForApplication.AvailableFreeSpace` - have you debuged it? – Romasz Nov 17 '14 at 09:35
  • the problem occurs on some users' devices. in my tests it never occurred – John Brush Nov 17 '14 at 09:39
  • Maybe you can try it other way - by properties - [like here](http://stackoverflow.com/questions/23445993/how-i-can-find-out-the-avaible-free-space-in-a-universal-windows-phone-8-1-app/23446870#23446870). – Romasz Nov 17 '14 at 10:22
  • this method works with app developer with wp 8.0? i receive "The method or operation is not implemented" – John Brush Nov 17 '14 at 10:46
  • You are right, they will work only under WP8.1 – Romasz Nov 17 '14 at 11:05

0 Answers0