1VFS(3) User Contributed Perl Documentation VFS(3)
2
3
4
6 Gnome2::VFS - (DEPRECATED) Perl interface to the 2.x series of the
7 GNOME VFS library
8
10 use Gnome2::VFS;
11
12 sub die_already {
13 my ($action) = @_;
14 die("An error occured while $action.\n");
15 }
16
17 die_already("initializing GNOME VFS") unless (Gnome2::VFS -> init());
18
19 my $source = "http://www.perldoc.com/about.html";
20 my ($result, $handle, $info);
21
22 # Open a connection to Perldoc.
23 ($result, $handle) = Gnome2::VFS -> open($source, "read");
24 die_already("opening connection to '$source'")
25 unless ($result eq "ok");
26
27 # Get the file information.
28 ($result, $info) = $handle -> get_file_info("default");
29 die_already("retrieving information about '$source'")
30 unless ($result eq "ok");
31
32 # Read the content.
33 my $bytes = $info -> { size };
34
35 my $bytes_read = 0;
36 my $buffer = "";
37
38 do {
39 my ($tmp_buffer, $tmp_bytes_read);
40
41 ($result, $tmp_bytes_read, $tmp_buffer) =
42 $handle -> read($bytes - $bytes_read);
43
44 $buffer .= $tmp_buffer;
45 $bytes_read += $tmp_bytes_read;
46 } while ($result eq "ok" and $bytes_read < $bytes);
47
48 die_already("reading $bytes bytes from '$source'")
49 unless ($result eq "ok" && $bytes_read == $bytes);
50
51 # Close the connection.
52 $result = $handle -> close();
53 die_already("closing connection to '$source'")
54 unless ($result eq "ok");
55
56 # Create and open the target.
57 my $target = "/tmp/" . $info -> { name };
58 my $uri = Gnome2::VFS::URI -> new($target);
59
60 ($result, $handle) = $uri -> create("write", 1, 0644);
61 die_already("creating '$target'") unless ($result eq "ok");
62
63 # Write to it.
64 my $bytes_written;
65
66 ($result, $bytes_written) = $handle -> write($buffer, $bytes);
67 die_already("writing $bytes bytes to '$target'")
68 unless ($result eq "ok" && $bytes_written == $bytes);
69
70 # Close the target.
71 $result = $handle -> close();
72 die_already("closing '$target'") unless ($result eq "ok");
73
74 Gnome2::VFS -> shutdown();
75
77 DEPRECATED This module allows you to interface with the GNOME Virtual
78 File System library. It provides the means to transparently access
79 files on all kinds of filesystems.
80
82 NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
83
84 This module has been deprecated by the Gtk-Perl project. This means
85 that the module will no longer be updated with security patches, bug
86 fixes, or when changes are made in the Perl ABI. The Git repo for this
87 module has been archived (made read-only), it will no longer possible
88 to submit new commits to it. You are more than welcome to ask about
89 this module on the Gtk-Perl mailing list, but our priorities going
90 forward will be maintaining Gtk-Perl modules that are supported and
91 maintained upstream; this module is neither.
92
93 Since this module is licensed under the LGPL v2, you may also fork this
94 module, if you wish, but you will need to use a different name for it
95 on CPAN, and the Gtk-Perl team requests that you use your own resources
96 (mailing list, Git repos, bug trackers, etc.) to maintain your fork
97 going forward.
98
99 • Perl URL: https://gitlab.gnome.org/GNOME/perl-gnome2-vfs
100
101 • Upstream URL: https://gitlab.gnome.org/Archive/gnome-vfs
102
103 • Last upstream version: 2.24.4
104
105 • Last upstream release date: 2010-09-28
106
107 • Migration path for this module: Glib::IO
108
109 • Migration module URL: https://metacpan.org/pod/Glib::IO
110
111 NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
112
113 Since this module tries to stick very closely to the C API, the
114 documentation found at
115
116 L<http://developer.gnome.org/doc/API/2.0/gnome-vfs-2.0/>
117
118 is the canonical reference.
119
120 In addition to that, there's also the automatically generated API
121 documentation: Gnome2::VFS::index.
122
123 The mapping described in Gtk2::api also applies to this module.
124
125 To discuss this module, ask questions and flame/praise the authors,
126 join gtk-perl-list@gnome.org at lists.gnome.org.
127
129 There are some memory leaks especially with respect to callbacks. This
130 mainly affects GnomeVFSAsync as well as some parts of GnomeVFSXfer and
131 GnomeVFSOps. GnomeVFSMime leaks some list data.
132
133 GnomeVFSAsync is also known to crash under certain conditions when
134 there are many concurrent transfers.
135
137 Gnome2::VFS::index, Glib, Gtk2, Gtk2::api.
138
140 Torsten Schoenfeld <kaffeetisch@web.de>.
141
143 Copyright (C) 2003-2007 by the gtk2-perl team (see the file AUTHORS)
144
145 This library is free software; you can redistribute it and/or modify it
146 under the terms of the GNU Lesser General Public License as published
147 by the Free Software Foundation; either version 2.1 of the License, or
148 (at your option) any later version.
149
150 This library is distributed in the hope that it will be useful, but
151 WITHOUT ANY WARRANTY; without even the implied warranty of
152 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
153 Lesser General Public License for more details.
154
155 You should have received a copy of the GNU Lesser General Public
156 License along with this library; if not, see
157 <https://www.gnu.org/licenses/>.
158
159
160
161perl v5.34.0 2021-07-22 VFS(3)