Switched to POSIX and C functions instead of QFile for stats file, since Qt couldn't get the permissions right.