void checkFreeSpace()

in src/main/cpp/launcher/windows/src/FileUtils.c [196:226]


void checkFreeSpace(LauncherProperties * props, WCHAR * tmpDir, int64t * size) {
    if(props->checkForFreeSpace) {
        int64t * space = getFreeSpace(tmpDir);
        DWORD   result = 0;
        result = ((space->High > size->High) ||
                (space->High == size->High && space->Low >= size->Low));
        
        if(!result) {            
            WCHAR * available = NULL;
            WCHAR * str = NULL;
            WCHAR * required = NULL;
            available = int64ttoWCHAR(space);
            required  = int64ttoWCHAR(size);
            str = appendStringW(str, L"Not enough free space in ");
            str = appendStringW(str, tmpDir);
            str = appendStringW(str, L", available=");
            str = appendStringW(str, available);
            str = appendStringW(str, L", required=");
            str = appendStringW(str, required);

            writeMessageW(props, OUTPUT_LEVEL_DEBUG, 1, str, 1);
            FREE(str);
            FREE(available);
            FREE(required);
            props->status = ERROR_FREESPACE;
        }
        FREE(space);
    } else {
        writeMessageA(props, OUTPUT_LEVEL_DEBUG, 0, "... free space checking is disabled", 1);
    }
}