Re: Open file in write mode problem



Thanks to Richard Hult I could do this some time ago. The solution he gave me is the same as yours!
But thanks any way!

On 4/24/06, Alexander Larsson <alexl redhat com> wrote:
On Mon, 2006-04-03 at 12:16 -0400, André Pedralho wrote:
> Hi all,
> I'm trying to port an app with some file interactions. I used to use
> only the stdio.h to open, read, write and close my text file, but now,
> I want to do this using the gnome VFS.
> Then, I've re-developed all the code, and I may open, read, write and
> close the file using the gnome VFS. However, when I close my app and
> run it again my file is erased by the gnome_vfs_open_uri(&handle, uri,
> GNOME_VFS_OPEN_WRITE), I mean, all the content of my file is erased.
> Following there is a piece of my code:

Pass in GNOME_VFS_OPEN_WRITE|GNOME_VFS_OPEN_RANDOM to gnome_vfs_open_uri
and the file won't be truncated.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Alexander Larsson                                            Red Hat, Inc
                   alexl redhat com    alla lysator liu se
He's a genetically engineered flyboy cat burglar on the wrong side of the law.
She's a sharp-shooting thirtysomething Hell's Angel with an incredible
destiny. They fight crime!




--
André Pedralho
Bachelor in Computer Science
Instituto Nokia de Tecnologia

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]