![]() |
![]() |
![]() |
![]() |
<GMappedFile>
The GMappedFile represents a file mapping created with
g_mapped_file_new()
. It has only private members and should
not be accessed directly.
(define-values () (mapped-file:free self))
This call existed before GMappedFile had refcounting and is currently
exactly the same as g_mapped_file_unref()
.
(define-values (%return) (mapped-file:get-bytes self))
Creates a new GBytes which references the data mapped from file
.
The mapped contents of the file must not be modified after creating this
bytes object, because a GBytes should be immutable.
(define-values (%return) (mapped-file:get-contents self))
Returns the contents of a GMappedFile.
Note that the contents may not be zero-terminated, even if the GMappedFile is backed by a text file.
If the file is empty then NULL
is returned.
(define-values (%return) (mapped-file:get-length self))
Returns the length of the contents of a GMappedFile.
(define-values (%return) (mapped-file:ref self))
Increments the reference count of file
by one. It is safe to call
this function from any thread.
(define-values () (mapped-file:unref self))
Decrements the reference count of file
by one. If the reference count
drops to 0, unmaps the buffer of file
and frees it.
It is safe to call this function from any thread.
Since 2.22