예제 #1
0
        public static bool CheckSpaceAvailable(Context context, DownloadDetails.RootDirectoryDetails root, long neededSpace)
        {
            var descriptor     = context.ContentResolver.OpenFileDescriptor(root.DocumentFile.Uri, "r");
            var stats          = Os.Fstatvfs(descriptor.FileDescriptor);
            var availableSpace = (stats.FBavail * stats.FBsize);

            return(neededSpace <= availableSpace);
        }