Use fopen instead of glib fopen as it can cause problem when glib fopen doesn't use the same descriptor as the one of the system.