Цитата(ViGOur @ 25.5.2009, 21:50)
Вот что написано в описании
GFileOutputStream (класс производный от
GOutputStream):
Цитата
GFileOutputStream implements GSeekable, which allows the output stream to jump to arbitrary positions in the file and to truncate the file, provided the filesystem of the file supports these operations. In addition to the generic g_seekable_ API, GFileOutputStream has its own API for seeking and positioning. To find the position of a file output stream, use g_file_output_stream_tell(). To find out if a file output stream supports seeking, use g_file_output_stream_can_seek(). To position a file output stream, use g_file_output_stream_seek(). To find out if a file output stream supports truncating, use g_file_output_stream_can_truncate(). To truncate a file output stream, use g_file_output_stream_truncate().
Функции перечисленные в конце цитаты уже не существуют, похоже разработчики забыли убрать их из документации, ну да Бог с ними ведь есть интерфейс GSeekable, но толку от него нет.
Поглядев в исходники:
g_file_append_to() открывает файл с параметром
O_APPEND, что не даёт использовать
g_seekable_seek().
g_file_replace() открывает файл и если он существует, то либо делает бэкап, либо просто стирает файл.
g_file_create() открывает с параметром
O_CREAT | O_EXCL, что вызывает ошибку если файл уже есть.
Больше функций для открытия нет, по видимому.
Вот если бы сделать хак и подменить дескриптор на другой с "правильными" параметрами ...