A workaround for the native, but buggy (?) fpassthru() function