MappedFile


Object Hierarchy:

GLib.MappedFile GLib.MappedFile GLib.MappedFile

Description:

[ Compact ]
[ Version ( since = "2.22" ) ]
[ CCode ( ref_function = "g_mapped_file_ref" , type_id = "G_TYPE_MAPPED_FILE" , unref_function = "g_mapped_file_unref" ) ]
public class MappedFile

The MappedFile represents a file mapping created with MappedFile.

It has only private members and should not be accessed directly.

Example: Map a file and print its content and size:

public static int main (string[] args) {
try {
MappedFile file = new MappedFile ("test.vala", false);
print ((string) file.get_contents ());
print ("Size: %" + size_t.FORMAT + " bytes\n", file.get_length ());
} catch (FileError e) {
print ("FileError: %s\n", e.message);
}
return 0;
}

valac --pkg glib-2.0 GLib.MappedFile.vala


Namespace: GLib
Package: glib-2.0

Content:

Creation methods:

Methods: