RE: Simple I/O with Gio::???
- From: Arbol One <arbolone gmail com>
- To: <gtkmm-list gnome org>
- Subject: RE: Simple I/O with Gio::???
- Date: Fri, 27 Jul 2012 00:36:57 -0400
Is there a tutorial for Gio?
-----Original Message-----
From: gtkmm-list-bounces gnome org [mailto:gtkmm-list-bounces gnome org] On
Behalf Of Florian Philipp
Sent: Monday, July 23, 2012 12:35 PM
To: gtkmm-list gnome org
Subject: Re: Simple I/O with Gio::???
Am 23.07.2012 17:57, schrieb Arbol One:
> I am looking for a tutorial on simple file I/O using Gio. All I want
> to do is to create/open a file, write to it and then delete it; all
> this in a local machine running Win7.
>
> I understand that the Gio library can do this simple things.
>
>
>
> TIA
>
>
How about this:
#include <giomm/file.h>
#include <giomm/fileoutputstream.h>
#include <glibmm/refptr.h>
void test()
{
using namespace Glib;
using namespace Gio;
RefPtr<File> file = File::create_for_path("test.txt");
RefPtr<FileOutputStream> stream = file->create_file();
stream->write("Hello world\n"); stream->close();
file->remove();
}
Take a look at the reference documentation. Start with Gio::File.
Regards,
Florian Philipp
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]