VirtualDesktops: Replace std::fstream with C file functions