### ----------------------------------------------------
### -- Gnome::Gio
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: lib/Gnome/Gio/File.rakumod
### ----------------------------------------------------
### -- Chunk 3 of 6
, e.g. "C:\Windows" or "/usr/bin/". This does not mean the file is local, as it might be on a locally mounted remote filesystem.

On some systems non-native files may be available using the native filesystem via a userspace filesystem (FUSE), in these cases this call will return C<False>, but C<get-path()> will still return a native path.

This call does no blocking I/O.

Returns: C<True> if I<file> is native

  method is-native ( --> Bool )

=end pod

method is-native ( --> Bool ) {
  g_file_is_native(self._get-native-object-no-reffing).Bool
}

sub g_file_is_native (
  N-GFile $file --> gboolean
) is native(&gio-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
# TM:0:load-bytes:
=begin pod
=head2 load-bytes

Loads the contents of I<file> and returns it as B<Gnome::Gio::Bytes>.

If I<file> is a resource:// based URI, the resulting bytes will reference the embedded resource instead of a copy. Otherwise, this is equivalent to calling C<load-contents()> and C<g-bytes-new-take()>.

For resources, I<etag-out> will be set to C<undefined>.

The data contained in the resulting B<Gnome::Gio::Bytes> is always zero-terminated, but this is not included in the B<Gnome::Gio::Bytes> length. The resulting B<Gnome::Gio::Bytes> should be freed with C<g-bytes-unref()> when no longer in use.

Returns: a B<Gnome::Gio::Bytes> or C<undefined> and I<error> is set

  method load-bytes ( GCancellable $cancellable, CArray[Str] $etag_out, N-GError $error --> N-GObject )

=item $cancellable; a B<Gnome::Gio::Cancellable> or C<undefined>
=item $etag_out; a location to place the current entity tag for the file, or C<undefined> if the entity tag is not needed
=item $error; a location for a B<Gnome::Gio::Error> or C<undefined>
=end pod

method load-bytes ( GCancellable $cancellable, CArray[Str] $etag_out, $error is copy --> N-GObject ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

  g_file_load_bytes(
    self._get-native-object-no-reffing, $cancellable, $etag_out, $error
  )
}

sub g_file_load_bytes (
  N-GFile $file, GCancellable $cancellable, gchar-pptr $etag_out, N-GError $error --> N-GObject
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:load-bytes-async:
=begin pod
=head2 load-bytes-async

Asynchronously loads the contents of I<file> as B<Gnome::Gio::Bytes>.

If I<file> is a resource:// based URI, the resulting bytes will reference the embedded resource instead of a copy. Otherwise, this is equivalent to calling C<load-contents-async()> and C<g-bytes-new-take()>.

I<callback> should call C<g-file-load-bytes-finish()> to get the result of this asynchronous operation.

See C<g-file-load-bytes()> for more information.

  method load-bytes-async ( GCancellable $cancellable, GAsyncReadyCallback $callback, Pointer $user_data )

=item $cancellable; a B<Gnome::Gio::Cancellable> or C<undefined>
=item $callback; (scope async): a B<Gnome::Gio::AsyncReadyCallback> to call when the request is satisfied
=item $user_data; (closure): the data to pass to callback function
=end pod

method load-bytes-async ( GCancellable $cancellable, GAsyncReadyCallback $callback, Pointer $user_data ) {

  g_file_load_bytes_async(
    self._get-native-object-no-reffing, $cancellable, $callback, $user_data
  );
}

sub g_file_load_bytes_async (
  N-GFile $file, GCancellable $cancellable, GAsyncReadyCallback $callback, gpointer $user_data
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:load-bytes-finish:
=begin pod
=head2 load-bytes-finish

Completes an asynchronous request to C<load-bytes-async()>.

For resources, I<etag-out> will be set to C<undefined>.

The data contained in the resulting B<Gnome::Gio::Bytes> is always zero-terminated, but this is not included in the B<Gnome::Gio::Bytes> length. The resulting B<Gnome::Gio::Bytes> should be freed with C<g-bytes-unref()> when no longer in use.

See C<g-file-load-bytes()> for more information.

Returns: a B<Gnome::Gio::Bytes> or C<undefined> and I<error> is set

  method load-bytes-finish ( GAsyncResult $result, CArray[Str] $etag_out, N-GError $error --> N-GObject )

=item $result; a B<Gnome::Gio::AsyncResult> provided to the callback
=item $etag_out; a location to place the current entity tag for the file, or C<undefined> if the entity tag is not needed
=item $error; a location for a B<Gnome::Gio::Error>, or C<undefined>
=end pod

method load-bytes-finish ( GAsyncResult $result, CArray[Str] $etag_out, $error is copy --> N-GObject ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

  g_file_load_bytes_finish(
    self._get-native-object-no-reffing, $result, $etag_out, $error
  )
}

sub g_file_load_bytes_finish (
  N-GFile $file, GAsyncResult $result, gchar-pptr $etag_out, N-GError $error --> N-GObject
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:load-contents:
=begin pod
=head2 load-contents

Loads the content of the file into memory. The data is always zero-terminated, but this is not included in the resultant I<length>. The returned I<content> should be freed with C<g-free()> when no longer needed.

If I<cancellable> is not C<undefined>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error C<G-IO-ERROR-CANCELLED> will be returned.

Returns: C<True> if the I<file>'s contents were successfully loaded. C<False> if there were errors.

  method load-contents ( GCancellable $cancellable, CArray[Str] $contents, UInt $length, CArray[Str] $etag_out, N-GError $error --> Bool )

=item $cancellable; optional B<Gnome::Gio::Cancellable> object, C<undefined> to ignore
=item $contents;   (element-type guint8) (array length=length): a location to place the contents of the file
=item $length; a location to place the length of the contents of the file, or C<undefined> if the length is not needed
=item $etag_out; a location to place the current entity tag for the file, or C<undefined> if the entity tag is not needed
=item $error; a B<Gnome::Gio::Error>, or C<undefined>
=end pod

method load-contents ( GCancellable $cancellable, CArray[Str] $contents, UInt $length, CArray[Str] $etag_out, $error is copy --> Bool ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

  g_file_load_contents(
    self._get-native-object-no-reffing, $cancellable, $contents, $length, $etag_out, $error
  ).Bool
}

sub g_file_load_contents (
  N-GFile $file, GCancellable $cancellable, gchar-pptr $contents, gsize $length, gchar-pptr $etag_out, N-GError $error --> gboolean
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:load-contents-async:
=begin pod
=head2 load-contents-async

Starts an asynchronous load of the I<file>'s contents.

For more details, see C<load-contents()> which is the synchronous version of this call.

When the load operation has completed, I<callback> will be called with I<user> data. To finish the operation, call C<g-file-load-contents-finish()> with the B<Gnome::Gio::AsyncResult> returned by the I<callback>.

If I<cancellable> is not C<undefined>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error C<G-IO-ERROR-CANCELLED> will be returned.

  method load-contents-async ( GCancellable $cancellable, GAsyncReadyCallback $callback, Pointer $user_data )

=item $cancellable; optional B<Gnome::Gio::Cancellable> object, C<undefined> to ignore
=item $callback; a B<Gnome::Gio::AsyncReadyCallback> to call when the request is satisfied
=item $user_data; the data to pass to callback function
=end pod

method load-contents-async ( GCancellable $cancellable, GAsyncReadyCallback $callback, Pointer $user_data ) {

  g_file_load_contents_async(
    self._get-native-object-no-reffing, $cancellable, $callback, $user_data
  );
}

sub g_file_load_contents_async (
  N-GFile $file, GCancellable $cancellable, GAsyncReadyCallback $callback, gpointer $user_data
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:load-contents-finish:
=begin pod
=head2 load-contents-finish

Finishes an asynchronous load of the I<file>'s contents. The contents are placed in I<contents>, and I<length> is set to the size of the I<contents> string. The I<content> should be freed with C<g-free()> when no longer needed. If I<etag-out> is present, it will be set to the new entity tag for the I<file>.

Returns: C<True> if the load was successful. If C<False> and I<error> is present, it will be set appropriately.

  method load-contents-finish ( GAsyncResult $res, CArray[Str] $contents, UInt $length, CArray[Str] $etag_out, N-GError $error --> Bool )

=item $res; a B<Gnome::Gio::AsyncResult>
=item $contents;   (element-type guint8) (array length=length): a location to place the contents of the file
=item $length; a location to place the length of the contents of the file, or C<undefined> if the length is not needed
=item $etag_out; a location to place the current entity tag for the file, or C<undefined> if the entity tag is not needed
=item $error; a B<Gnome::Gio::Error>, or C<undefined>
=end pod

method load-contents-finish ( GAsyncResult $res, CArray[Str] $contents, UInt $length, CArray[Str] $etag_out, $error is copy --> Bool ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

  g_file_load_contents_finish(
    self._get-native-object-no-reffing, $res, $contents, $length, $etag_out, $error
  ).Bool
}

sub g_file_load_contents_finish (
  N-GFile $file, GAsyncResult $res, gchar-pptr $contents, gsize $length, gchar-pptr $etag_out, N-GError $error --> gboolean
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:load-partial-contents-async:
=begin pod
=head2 load-partial-contents-async

Reads the partial contents of a file. A B<Gnome::Gio::FileReadMoreCallback> should be used to stop reading from the file when appropriate, else this function will behave exactly as C<load-contents-async()>. This operation can be finished by C<g-file-load-partial-contents-finish()>.

Users of this function should be aware that I<user-data> is passed to both the I<read-more-callback> and the I<callback>.

If I<cancellable> is not C<undefined>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error C<G-IO-ERROR-CANCELLED> will be returned.

  method load-partial-contents-async ( GCancellable $cancellable, GFileReadMoreCallback $read_more_callback, GAsyncReadyCallback $callback, Pointer $user_data )

=item $cancellable; optional B<Gnome::Gio::Cancellable> object, C<undefined> to ignore
=item $read_more_callback; (scope call) (closure user-data): a B<Gnome::Gio::FileReadMoreCallback> to receive partial data and to specify whether further data should be read
=item $callback; (scope async) (closure user-data): a B<Gnome::Gio::AsyncReadyCallback> to call when the request is satisfied
=item $user_data; the data to pass to the callback functions
=end pod

method load-partial-contents-async ( GCancellable $cancellable, GFileReadMoreCallback $read_more_callback, GAsyncReadyCallback $callback, Pointer $user_data ) {

  g_file_load_partial_contents_async(
    self._get-native-object-no-reffing, $cancellable, $read_more_callback, $callback, $user_data
  );
}

sub g_file_load_partial_contents_async (
  N-GFile $file, GCancellable $cancellable, GFileReadMoreCallback $read_more_callback, GAsyncReadyCallback $callback, gpointer $user_data
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:load-partial-contents-finish:
=begin pod
=head2 load-partial-contents-finish

Finishes an asynchronous partial load operation that was started with C<load-partial-contents-async()>. The data is always zero-terminated, but this is not included in the resultant I<length>. The returned I<content> should be freed with C<g-free()> when no longer needed.

Returns: C<True> if the load was successful. If C<False> and I<error> is present, it will be set appropriately.

  method load-partial-contents-finish ( GAsyncResult $res, CArray[Str] $contents, UInt $length, CArray[Str] $etag_out, N-GError $error --> Bool )

=item $res; a B<Gnome::Gio::AsyncResult>
=item $contents;   (element-type guint8) (array length=length): a location to place the contents of the file
=item $length; a location to place the length of the contents of the file, or C<undefined> if the length is not needed
=item $etag_out; a location to place the current entity tag for the file, or C<undefined> if the entity tag is not needed
=item $error; a B<Gnome::Gio::Error>, or C<undefined>
=end pod

method load-partial-contents-finish ( GAsyncResult $res, CArray[Str] $contents, UInt $length, CArray[Str] $etag_out, $error is copy --> Bool ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

  g_file_load_partial_contents_finish(
    self._get-native-object-no-reffing, $res, $contents, $length, $etag_out, $error
  ).Bool
}

sub g_file_load_partial_contents_finish (
  N-GFile $file, GAsyncResult $res, gchar-pptr $contents, gsize $length, gchar-pptr $etag_out, N-GError $error --> gboolean
) is native(&gio-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
# TM:0:make-directory:
=begin pod
=head2 make-directory

Creates a directory. Note that this will only create a child directory of the immediate parent directory of the path or URI given by the B<Gnome::Gio::File>. To recursively create directories, see C<make-directory-with-parents()>. This function will fail if the parent directory does not exist, setting I<error> to C<G-IO-ERROR-NOT-FOUND>. If the file system doesn't support creating directories, this function will fail, setting I<error> to C<G-IO-ERROR-NOT-SUPPORTED>.

For a local B<Gnome::Gio::File> the newly created directory will have the default (current) ownership and permissions of the current process.

If I<cancellable> is not C<undefined>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error C<G-IO-ERROR-CANCELLED> will be returned.

Returns: C<True> on successful creation, C<False> otherwise.

  method make-directory ( GCancellable $cancellable, N-GError $error --> Bool )

=item $cancellable; optional B<Gnome::Gio::Cancellable> object, C<undefined> to ignore
=item $error; a B<Gnome::Gio::Error>, or C<undefined>
=end pod

method make-directory ( GCancellable $cancellable, $error is copy --> Bool ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

  g_file_make_directory(
    self._get-native-object-no-reffing, $cancellable, $error
  ).Bool
}

sub g_file_make_directory (
  N-GFile $file, GCancellable $cancellable, N-GError $error --> gboolean
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:make-directory-async:
=begin pod
=head2 make-directory-async

Asynchronously creates a directory.

Virtual: make-directory-async

  method make-directory-async ( Int() $io_priority, GCancellable $cancellable, GAsyncReadyCallback $callback, Pointer $user_data )

=item $io_priority; the [I/O priority][io-priority] of the request
=item $cancellable; optional B<Gnome::Gio::Cancellable> object, C<undefined> to ignore
=item $callback; a B<Gnome::Gio::AsyncReadyCallback> to call when the request is satisfied
=item $user_data; the data to pass to callback function
=end pod

method make-directory-async ( Int() $io_priority, GCancellable $cancellable, GAsyncReadyCallback $callback, Pointer $user_data ) {

  g_file_make_directory_async(
    self._get-native-object-no-reffing, $io_priority, $cancellable, $callback, $user_data
  );
}

sub g_file_make_directory_async (
  N-GFile $file, int $io_priority, GCancellable $cancellable, GAsyncReadyCallback $callback, gpointer $user_data
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:make-directory-finish:
=begin pod
=head2 make-directory-finish

Finishes an asynchronous directory creation, started with C<make-directory-async()>.

Virtual: make-directory-finish

Returns: C<True> on successful directory creation, C<False> otherwise.

  method make-directory-finish ( GAsyncResult $result, N-GError $error --> Bool )

=item $result; a B<Gnome::Gio::AsyncResult>
=item $error; a B<Gnome::Gio::Error>, or C<undefined>
=end pod

method make-directory-finish ( GAsyncResult $result, $error is copy --> Bool ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

  g_file_make_directory_finish(
    self._get-native-object-no-reffing, $result, $error
  ).Bool
}

sub g_file_make_directory_finish (
  N-GFile $file, GAsyncResult $result, N-GError $error --> gboolean
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:make-directory-with-parents:
=begin pod
=head2 make-directory-with-parents

Creates a directory and any parent directories that may not exist similar to 'mkdir -p'. If the file system does not support creating directories, this function will fail, setting I<error> to C<G-IO-ERROR-NOT-SUPPORTED>. If the directory itself already exists, this function will fail setting I<error> to C<G-IO-ERROR-EXISTS>, unlike the similar C<g-mkdir-with-parents()>.

For a local B<Gnome::Gio::File> the newly created directories will have the default (current) ownership and permissions of the current process.

If I<cancellable> is not C<undefined>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error C<G-IO-ERROR-CANCELLED> will be returned.

Returns: C<True> if all directories have been successfully created, C<False> otherwise.

  method make-directory-with-parents ( GCancellable $cancellable, N-GError $error --> Bool )

=item $cancellable; optional B<Gnome::Gio::Cancellable> object, C<undefined> to ignore
=item $error; a B<Gnome::Gio::Error>, or C<undefined>
=end pod

method make-directory-with-parents ( GCancellable $cancellable, $error is copy --> Bool ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

  g_file_make_directory_with_parents(
    self._get-native-object-no-reffing, $cancellable, $error
  ).Bool
}

sub g_file_make_directory_with_parents (
  N-GFile $file, GCancellable $cancellable, N-GError $error --> gboolean
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:make-symbolic-link:
=begin pod
=head2 make-symbolic-link

Creates a symbolic link named I<file> which contains the string I<symlink-value>.

If I<cancellable> is not C<undefined>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error C<G-IO-ERROR-CANCELLED> will be returned.

Returns: C<True> on the creation of a new symlink, C<False> otherwise.

  method make-symbolic-link ( Str $symlink_value, GCancellable $cancellable, N-GError $error --> Bool )

=item $symlink_value; (type filename): a string with the path for the target of the new symlink
=item $cancellable; optional B<Gnome::Gio::Cancellable> object, C<undefined> to ignore
=item $error; a B<Gnome::Gio::Error>
=end pod

method make-symbolic-link ( Str $symlink_value, GCancellable $cancellable, $error is copy --> Bool ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

  g_file_make_symbolic_link(
    self._get-native-object-no-reffing, $symlink_value, $cancellable, $error
  ).Bool
}

sub g_file_make_symbolic_link (
  N-GFile $file, gchar-ptr $symlink_value, GCancellable $cancellable, N-GError $error --> gboolean
) is native(&gio-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
# TM:0:measure-disk-usage:
=begin pod
=head2 measure-disk-usage

Recursively measures the disk usage of I<file>.

This is essentially an analog of the 'du' command, but it also reports the number of directories and non-directory files encountered (including things like symbolic links).

By default, errors are only reported against the toplevel file itself. Errors found while recursing are silently ignored, unless C<G-FILE-DISK-USAGE-REPORT-ALL-ERRORS> is given in I<flags>.

The returned size, I<disk-usage>, is in bytes and should be formatted with C<g-format-size()> in order to get something reasonable for showing in a user interface.

I<progress-callback> and I<progress-data> can be given to request periodic progress updates while scanning. See the documentation for B<Gnome::Gio::FileMeasureProgressCallback> for information about when and how the callback will be invoked.

Returns: C<True> if successful, with the out parameters set. C<False> otherwise, with I<error> set.

  method measure-disk-usage ( UInt $flags, GCancellable $cancellable, GFileMeasureProgressCallback $progress_callback, Pointer $progress_data, UInt $disk_usage, UInt $num_dirs, UInt $num_files, N-GError $error --> Bool )

=item $flags; B<Gnome::Gio::FileMeasureFlags>
=item $cancellable; optional B<Gnome::Gio::Cancellable>
=item $progress_callback; a B<Gnome::Gio::FileMeasureProgressCallback>
=item $progress_data; user-data for I<progress-callback>
=item $disk_usage; the number of bytes of disk space used
=item $num_dirs; the number of directories encountered
=item $num_files; the number of non-directories encountered
=item $error; C<undefined>, or a pointer to a C<undefined> B<Gnome::Gio::Error> pointer
=end pod

method measure-disk-usage ( UInt $flags, GCancellable $cancellable, GFileMeasureProgressCallback $progress_callback, Pointer $progress_data, UInt $disk_usage, UInt $num_dirs, UInt $num_files, $error is copy --> Bool ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

  g_file_measure_disk_usage(
    self._get-native-object-no-reffing, $flags, $cancellable, $progress_callback, $progress_data, $disk_usage, $num_dirs, $num_files, $error
  ).Bool
}

sub g_file_measure_disk_usage (
  N-GFile $file, GFlag $flags, GCancellable $cancellable, GFileMeasureProgressCallback $progress_callback, gpointer $progress_data, guint64 $disk_usage, guint64 $num_dirs, guint64 $num_files, N-GError $error --> gboolean
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:measure-disk-usage-async:
=begin pod
=head2 measure-disk-usage-async

Recursively measures the disk usage of I<file>.

This is the asynchronous version of C<measure-disk-usage()>. See there for more information.

  method measure-disk-usage-async ( UInt $flags, Int() $io_priority, GCancellable $cancellable, GFileMeasureProgressCallback $progress_callback, Pointer $progress_data, GAsyncReadyCallback $callback, Pointer $user_data )

=item $flags; B<Gnome::Gio::FileMeasureFlags>
=item $io_priority; the [I/O priority][io-priority] of the request
=item $cancellable; optional B<Gnome::Gio::Cancellable>
=item $progress_callback; a B<Gnome::Gio::FileMeasureProgressCallback>
=item $progress_data; user-data for I<progress-callback>
=item $callback; a B<Gnome::Gio::AsyncReadyCallback> to call when complete
=item $user_data; the data to pass to callback function
=end pod

method measure-disk-usage-async ( UInt $flags, Int() $io_priority, GCancellable $cancellable, GFileMeasureProgressCallback $progress_callback, Pointer $progress_data, GAsyncReadyCallback $callback, Pointer $user_data ) {

  g_file_measure_disk_usage_async(
    self._get-native-object-no-reffing, $flags, $io_priority, $cancellable, $progress_callback, $progress_data, $callback, $user_data
  );
}

sub g_file_measure_disk_usage_async (
  N-GFile $file, GFlag $flags, gint $io_priority, GCancellable $cancellable, GFileMeasureProgressCallback $progress_callback, gpointer $progress_data, GAsyncReadyCallback $callback, gpointer $user_data
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:measure-disk-usage-finish:
=begin pod
=head2 measure-disk-usage-finish

Collects the results from an earlier call to C<measure-disk-usage-async()>. See C<g-file-measure-disk-usage()> for more information.

Returns: C<True> if successful, with the out parameters set. C<False> otherwise, with I<error> set.

  method measure-disk-usage-finish ( GAsyncResult $result, UInt $disk_usage, UInt $num_dirs, UInt $num_files, N-GError $error --> Bool )

=item $result; the B<Gnome::Gio::AsyncResult> passed to your B<Gnome::Gio::AsyncReadyCallback>
=item $disk_usage; the number of bytes of disk space used
=item $num_dirs; the number of directories encountered
=item $num_files; the number of non-directories encountered
=item $error; C<undefined>, or a pointer to a C<undefined> B<Gnome::Gio::Error> pointer
=end pod

method measure-disk-usage-finish ( GAsyncResult $result, UInt $disk_usage, UInt $num_dirs, UInt $num_files, $error is copy --> Bool ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

  g_file_measure_disk_usage_finish(
    self._get-native-object-no-reffing, $result, $disk_usage, $num_dirs, $num_files, $error
  ).Bool
}

sub g_file_measure_disk_usage_finish (
  N-GFile $file, GAsyncResult $result, guint64 $disk_usage, guint64 $num_dirs, guint64 $num_files, N-GError $error --> gboolean
) is native(&gio-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
# TM:0:monitor:
=begin pod
=head2 monitor

Obtains a file or directory monitor for the given file, depending on the type of the file.

If I<cancellable> is not C<undefined>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error C<G-IO-ERROR-CANCELLED> will be returned.

Returns: a B<Gnome::Gio::FileMonitor> for the given I<file>, or C<undefined> on error. Free the returned object with C<clear-object()>.

  method monitor ( GFileMonitorFlags $flags, GCancellable $cancellable, N-GError $error --> GFileMonitor )

=item $flags; a set of B<Gnome::Gio::FileMonitorFlags>
=item $cancellable; optional B<Gnome::Gio::Cancellable> object, C<undefined> to ignore
=item $error; a B<Gnome::Gio::Error>, or C<undefined>
=end pod

method monitor ( GFileMonitorFlags $flags, GCancellable $cancellable, $error is copy --> GFileMonitor ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

  g_file_monitor(
    self._get-native-object-no-reffing, $flags, $cancellable, $error
  )
}

sub g_file_monitor (
  N-GFile $file, GFlag $flags, GCancellable $cancellable, N-GError $error --> GFileMonitor
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:monitor-directory:
=begin pod
=head2 monitor-directory

Obtains a directory monitor for the given file. This may fail if directory monitoring is not supported.

If I<cancellable> is not C<undefined>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error C<G-IO-ERROR-CANCELLED> will be returned.

It does not make sense for I<flags> to contain C<G-FILE-MONITOR-WATCH-HARD-LINKS>, since hard links can not be made to directories. It is not possible to monitor all the files in a directory for changes made via hard links; if you want to do this then you must register individual watches with C<monitor()>.

Virtual: monitor-dir

Returns: a B<Gnome::Gio::FileMonitor> for the given I<file>, or C<undefined> on error. Free the returned object with C<clear-object()>.

  method monitor-directory ( GFileMonitorFlags $flags, GCancellable $cancellable, N-GError $error --> GFileMonitor )

=item $flags; a set of B<Gnome::Gio::FileMonitorFlags>
=item $cancellable; optional B<Gnome::Gio::Cancellable> object, C<undefined> to ignore
=item $error; a B<Gnome::Gio::Error>, or C<undefined>
=end pod

method monitor-directory ( GFileMonitorFlags $flags, GCancellable $cancellable, $error is copy --> GFileMonitor ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

  g_file_monitor_directory(
    self._get-native-object-no-reffing, $flags, $cancellable, $error
  )
}

sub g_file_monitor_directory (
  N-GFile $file, GFlag $flags, GCancellable $cancellable, N-GError $error --> GFileMonitor
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:monitor-file:
=begin pod
=head2 monitor-file

Obtains a file monitor for the given file. If no file notification mechanism exists, then regular polling of the file is used.

If I<cancellable> is not C<undefined>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error C<G-IO-ERROR-CANCELLED> will be returned.

If I<flags> contains C<G-FILE-MONITOR-WATCH-HARD-LINKS> then the monitor will also attempt to report changes made to the file via another filename (ie, a hard link). Without this flag, you can only rely on changes made through the filename contained in I<file> to be reported. Using this flag may result in an increase in resource usage, and may not have any effect depending on the B<Gnome::Gio::FileMonitor> backend and/or filesystem type.

Returns: a B<Gnome::Gio::FileMonitor> for the given I<file>, or C<undefined> on error. Free the returned object with C<clear-object()>.

  method monitor-file ( GFileMonitorFlags $flags, GCancellable $cancellable, N-GError $error --> GFileMonitor )

=item $flags; a set of B<Gnome::Gio::FileMonitorFlags>
=item $cancellable; optional B<Gnome::Gio::Cancellable> object, C<undefined> to ignore
=item $error; a B<Gnome::Gio::Error>, or C<undefined>
=end pod

method monitor-file ( GFileMonitorFlags $flags, GCancellable $cancellable, $error is copy --> GFileMonitor ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

  g_file_monitor_file(
    self._get-native-object-no-reffing, $flags, $cancellable, $error
  )
}

sub g_file_monitor_file (
  N-GFile $file, GFlag $flags, GCancellable $cancellable, N-GError $error --> GFileMonitor
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:mount-enclosing-volume:
=begin pod
=head2 mount-enclosing-volume

Starts a I<mount-operation>, mounting the volume that contains the file I<location>.

When this operation has completed, I<callback> will be called with I<user-user> data, and the operation can be finalized with C<mount-enclosing-volume-finish()>.

If I<cancellable> is not C<undefined>, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error C<G-IO-ERROR-CANCELLED> will be returned.

  method mount-enclosing-volume ( GMountMountFlags $flags, GMountOperation $mount_operation, GCancellable $cancellable, GAsyncReadyCallback $callback, Pointer $user_data )

=item $flags; flags affecting the operation
=item $mount_operation; a B<Gnome::Gio::MountOperation> or C<undefined> to avoid user interaction
=item $cancellable; optional B<Gnome::Gio::Cancellable> object, C<undefined> to ignore
=item $callback; a B<Gnome::Gio::AsyncReadyCallback> to call when the request is satisfied, or C<undefined>
=item $user_data; the data to pass to callback function
=end pod

method mount-enclosing-volume ( GMountMountFlags $flags, GMountOperation $mount_operation, GCancellable $cancellable, GAsyncReadyCallback $callback, Pointer $user_data ) {

  g_file_mount_enclosing_volume(
    self._get-native-object-no-reffing, $flags, $mount_operation, $cancellable, $callback, $user_data
 