Make the code compile also in g++ 4.7 where read/write are not