Forum: Ruby-Gnome 2 problem with using GLib::File

F889bf17449ffbf62345d2b2d316a937?d=identicon&s=25 Michal Suchanek (Guest)
on 2011-06-06 19:21
(Received via mailing list)
Hello

I tried to put together a test application that opens a file.

Unfortunately, the line with GLib::File.read returns:

fdialog.rb:16:in `filechooserbutton1_file_set_cb': uninitialized
constant GLib::File

I use

require 'libglade2'
require 'glib2'

what do I need to read a file?

Where can I find the required library for an object like GLib::File?

The page http://ruby-gnome2.sourceforge.jp/hiki.cgi?GLib%3A%3AFile
does not state requirements.

Thanks

Michal
3853dd5371ac1e094fc45d6c2aa0e459?d=identicon&s=25 Carlo E. Prelz (Guest)
on 2011-06-06 20:56
(Received via mailing list)
Subject: [ruby-gnome2-devel-en] problem with using GLib::File
  Date: lun 06 giu 11 07:20:12 +0200

Quoting Michal Suchanek (hramrach@centrum.cz):

> require 'glib2'
>
> what do I need to read a file?

The File class is included in the default Ruby library, not in Glib.

You must use File in place of GLib::File if you want your program to
access files.

Carlo

--
  *         Se la Strada e la sua Virtu' non fossero state messe da
parte,
* K * Carlo E. Prelz - fluido@fluido.as             che bisogno ci
sarebbe
  *               di parlare tanto di amore e di rettitudine?
(Chuang-Tzu)
F889bf17449ffbf62345d2b2d316a937?d=identicon&s=25 Michal Suchanek (Guest)
on 2011-06-07 09:07
(Received via mailing list)
On 6 June 2011 20:29, Carlo E. Prelz <fluido@fluido.as> wrote:
>> constant GLib::File
> You must use File in place of GLib::File if you want your program to
> access files.
>
> Carlo
>

Then my program won't be able to access my files because they are only
reachable through gvfs.

Thanks

Michal
F889bf17449ffbf62345d2b2d316a937?d=identicon&s=25 Michal Suchanek (Guest)
on 2011-06-07 12:26
(Received via mailing list)
On 7 June 2011 09:07, Michal Suchanek <hramrach@centrum.cz> wrote:
>>> fdialog.rb:16:in `filechooserbutton1_file_set_cb': uninitialized
>>
>> You must use File in place of GLib::File if you want your program to
>> access files.
>>
>> Carlo
>>
>
> Then my program won't be able to access my files because they are only
> reachable through gvfs.

Also, what does
http://ruby-gnome2.sourceforge.jp/hiki.cgi?GLib%3A%3AFile describe?

A non-existent module?

Thanks

Michal
5e3ddca8ea910cea06245c7b3c38007a?d=identicon&s=25 jake kaiden (lljk)
on 2011-06-08 20:59
Michal Suchanek wrote in post #1003626:

> Then my program won't be able to access my files because they are only
> reachable through gvfs.

  have you tried ruby/gnomevfs?  never used it myself, but looks like it
could work for you...

http://ruby-gnome2.sourceforge.jp/hiki.cgi?Ruby/GnomeVFS


  cheers,

  - j
3807680355002d0d5e8314a97333587e?d=identicon&s=25 Nikolai Weibull (Guest)
on 2011-06-12 22:08
(Received via mailing list)
On Mon, Jun 6, 2011 at 19:20, Michal Suchanek <hramrach@centrum.cz>
wrote:

> what do I need to read a file?

require 'gio2'
F889bf17449ffbf62345d2b2d316a937?d=identicon&s=25 Michal Suchanek (Guest)
on 2011-06-29 14:15
(Received via mailing list)
Hello

On 12 June 2011 22:08, Nikolai Weibull <now@bitwi.se> wrote:
> On Mon, Jun 6, 2011 at 19:20, Michal Suchanek <hramrach@centrum.cz> wrote:
>
>> what do I need to read a file?
>
> require 'gio2'

with recent ruby-gnome2 I get gio2 which provides the GLib::File module.

(GLib::File.new_for_uri uri).read.close returns true so I guess I can
read files.

Thanks

Michal
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.