### ----------------------------------------------------
### -- Gnome::Gio
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: lib/Gnome/Gio/File.rakumod
### ----------------------------------------------------
### -- Chunk 5 of 6
<undefined> to ignore
=item $error; a B<Gnome::Gio::Error>, or C<undefined>
=end pod

method query-settable-attributes ( GCancellable $cancellable, $error is copy --> GFileAttributeInfoList ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

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

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

#-------------------------------------------------------------------------------
# TM:0:query-writable-namespaces:
=begin pod
=head2 query-writable-namespaces

Obtain the list of attribute namespaces where new attributes can be created by a user. An example of this is extended attributes (in the "xattr" namespace).

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::FileAttributeInfoList> describing the writable namespaces. When you are done with it, release it with C<attribute-info-list-unref()>

  method query-writable-namespaces ( GCancellable $cancellable, N-GError $error --> GFileAttributeInfoList )

=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 query-writable-namespaces ( GCancellable $cancellable, $error is copy --> GFileAttributeInfoList ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

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

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

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

Opens a file for reading. The result is a B<Gnome::Gio::FileInputStream> that can be used to read the contents 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.

If the file does not exist, the C<G-IO-ERROR-NOT-FOUND> error will be returned. If the file is a directory, the C<G-IO-ERROR-IS-DIRECTORY> error will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on.

Virtual: read-fn

Returns: B<Gnome::Gio::FileInputStream> or C<undefined> on error. Free the returned object with C<clear-object()>.

  method read ( GCancellable $cancellable, N-GError $error --> GFileInputStream )

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

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

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

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

#-------------------------------------------------------------------------------
# TM:0:read-async:
=begin pod
=head2 read-async

Asynchronously opens I<file> for reading.

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

When the operation is finished, I<callback> will be called. You can then call C<g-file-read-finish()> to get the result of the operation.

  method read-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; (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 read-async ( Int() $io_priority, GCancellable $cancellable, GAsyncReadyCallback $callback, Pointer $user_data ) {

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

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

#-------------------------------------------------------------------------------
# TM:0:read-finish:
=begin pod
=head2 read-finish

Finishes an asynchronous file read operation started with C<read-async()>.

Returns: a B<Gnome::Gio::FileInputStream> or C<undefined> on error. Free the returned object with C<clear-object()>.

  method read-finish ( GAsyncResult $res, N-GError $error --> GFileInputStream )

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

method read-finish ( GAsyncResult $res, $error is copy --> GFileInputStream ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

  g_file_read_finish(
    self._get-native-object-no-reffing, $res, $error
  )
}

sub g_file_read_finish (
  N-GFile $file, GAsyncResult $res, N-GError $error --> GFileInputStream
) is native(&gio-lib)
  { * }
}}

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

Returns an output stream for overwriting the file, possibly creating a backup copy of the file first. If the file doesn't exist, it will be created.

This will try to replace the file in the safest way possible so that any errors during the writing will not affect an already existing copy of the file. For instance, for local files it may write to a temporary file and then atomically rename over the destination when the stream is closed.

By default files created are generally readable by everyone, but if you pass B<Gnome::Gio::-FILE-CREATE-PRIVATE> in I<flags> the file will be made readable only to the current user, to the level that is supported on the target filesystem.

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 you pass in a non-C<undefined> I<etag> value and I<file> already exists, then this value is compared to the current entity tag of the file, and if they differ an C<G-IO-ERROR-WRONG-ETAG> error is returned. This generally means that the file has been changed since you last read it. You can get the new etag from C<output-stream-get-etag()> after you've finished writing and closed the B<Gnome::Gio::FileOutputStream>. When you load a new file you can use C<g-file-input-stream-query-info()> to get the etag of the file.

If I<make-backup> is C<True>, this function will attempt to make a backup of the current file before overwriting it. If this fails a C<G-IO-ERROR-CANT-CREATE-BACKUP> error will be returned. If you want to replace anyway, try again with I<make-backup> set to C<False>.

If the file is a directory the C<G-IO-ERROR-IS-DIRECTORY> error will be returned, and if the file is some other form of non-regular file then a C<G-IO-ERROR-NOT-REGULAR-FILE> error will be returned. Some file systems don't allow all file names, and may return an C<G-IO-ERROR-INVALID-FILENAME> error, and if the name is to long C<G-IO-ERROR-FILENAME-TOO-LONG> will be returned. Other errors are possible too, and depend on what kind of filesystem the file is on.

Returns: a B<Gnome::Gio::FileOutputStream> or C<undefined> on error. Free the returned object with C<clear-object()>.

  method replace ( Str $etag, Bool $make_backup, UInt $flags, GCancellable $cancellable, N-GError $error --> GFileOutputStream )

=item $etag; an optional [entity tag][gfile-etag] for the current B<Gnome::Gio::File>, or B<NULL> to ignore
=item $make_backup; C<True> if a backup should be created
=item $flags; a set of B<Gnome::Gio::FileCreateFlags>
=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 replace ( Str $etag, Bool $make_backup, UInt $flags, GCancellable $cancellable, $error is copy --> GFileOutputStream ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

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

sub g_file_replace (
  N-GFile $file, gchar-ptr $etag, gboolean $make_backup, GFlag $flags, GCancellable $cancellable, N-GError $error --> GFileOutputStream
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:replace-async:
=begin pod
=head2 replace-async

Asynchronously overwrites the file, replacing the contents, possibly creating a backup copy of the file first.

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

When the operation is finished, I<callback> will be called. You can then call C<g-file-replace-finish()> to get the result of the operation.

  method replace-async ( Str $etag, Bool $make_backup, UInt $flags, Int() $io_priority, GCancellable $cancellable, GAsyncReadyCallback $callback, Pointer $user_data )

=item $etag; an [entity tag][gfile-etag] for the current B<Gnome::Gio::File>, or C<undefined> to ignore
=item $make_backup; C<True> if a backup should be created
=item $flags; a set of B<Gnome::Gio::FileCreateFlags>
=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; (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 replace-async ( Str $etag, Bool $make_backup, UInt $flags, Int() $io_priority, GCancellable $cancellable, GAsyncReadyCallback $callback, Pointer $user_data ) {

  g_file_replace_async(
    self._get-native-object-no-reffing, $etag, $make_backup, $flags, $io_priority, $cancellable, $callback, $user_data
  );
}

sub g_file_replace_async (
  N-GFile $file, gchar-ptr $etag, gboolean $make_backup, GFlag $flags, int $io_priority, GCancellable $cancellable, GAsyncReadyCallback $callback, gpointer $user_data
) is native(&gio-lib)
  { * }

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

Replaces the contents of I<file> with I<contents> of I<length> bytes.

If I<etag> is specified (not C<undefined>), any existing file must have that etag, or the error C<G-IO-ERROR-WRONG-ETAG> will be returned.

If I<make-backup> is C<True>, this function will attempt to make a backup of I<file>. Internally, it uses C<replace()>, so will try to replace the file contents in the safest way possible. For example, atomic renames are used when replacing local files’ contents.

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.

The returned I<new-etag> can be used to verify that the file hasn't changed the next time it is saved over.

Returns: C<True> if successful. If an error has occurred, this function will return C<False> and set I<error> appropriately if present.

  method replace-contents ( Str $contents, UInt $length, Str $etag, Bool $make_backup, UInt $flags, CArray[Str] $new_etag, GCancellable $cancellable, N-GError $error --> Bool )

=item $contents; (element-type guint8) (array length=length): a string containing the new contents for I<file>
=item $length; the length of I<contents> in bytes
=item $etag; the old [entity-tag][gfile-etag] for the document, or C<undefined>
=item $make_backup; C<True> if a backup should be created
=item $flags; a set of B<Gnome::Gio::FileCreateFlags>
=item $new_etag; a location to a new [entity tag][gfile-etag] for the document. This should be freed with C<g-free()> when no longer needed, or C<undefined>
=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 replace-contents ( Str $contents, UInt $length, Str $etag, Bool $make_backup, UInt $flags, CArray[Str] $new_etag, GCancellable $cancellable, $error is copy --> Bool ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

  g_file_replace_contents(
    self._get-native-object-no-reffing, $contents, $length, $etag, $make_backup, $flags, $new_etag, $cancellable, $error
  ).Bool
}

sub g_file_replace_contents (
  N-GFile $file, gchar-ptr $contents, gsize $length, gchar-ptr $etag, gboolean $make_backup, GFlag $flags, gchar-pptr $new_etag, GCancellable $cancellable, N-GError $error --> gboolean
) is native(&gio-lib)
  { * }

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

Starts an asynchronous replacement of I<file> with the given I<contents> of I<length> bytes. I<etag> will replace the document's current entity tag.

When this operation has completed, I<callback> will be called with I<user-user> data, and the operation can be finalized with C<replace-contents-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.

If I<make-backup> is C<True>, this function will attempt to make a backup of I<file>.

Note that no copy of I<content> will be made, so it must stay valid until I<callback> is called. See C<g-file-replace-contents-bytes-async()> for a B<Gnome::Gio::Bytes> version that will automatically hold a reference to the contents (without copying) for the duration of the call.

  method replace-contents-async ( Str $contents, UInt $length, Str $etag, Bool $make_backup, UInt $flags, GCancellable $cancellable, GAsyncReadyCallback $callback, Pointer $user_data )

=item $contents; (element-type guint8) (array length=length): string of contents to replace the file with
=item $length; the length of I<contents> in bytes
=item $etag; a new [entity tag][gfile-etag] for the I<file>, or C<undefined>
=item $make_backup; C<True> if a backup should be created
=item $flags; a set of B<Gnome::Gio::FileCreateFlags>
=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 replace-contents-async ( Str $contents, UInt $length, Str $etag, Bool $make_backup, UInt $flags, GCancellable $cancellable, GAsyncReadyCallback $callback, Pointer $user_data ) {

  g_file_replace_contents_async(
    self._get-native-object-no-reffing, $contents, $length, $etag, $make_backup, $flags, $cancellable, $callback, $user_data
  );
}

sub g_file_replace_contents_async (
  N-GFile $file, gchar-ptr $contents, gsize $length, gchar-ptr $etag, gboolean $make_backup, GFlag $flags, GCancellable $cancellable, GAsyncReadyCallback $callback, gpointer $user_data
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:replace-contents-bytes-async:
=begin pod
=head2 replace-contents-bytes-async

Same as C<replace-contents-async()> but takes a B<Gnome::Gio::Bytes> input instead. This function will keep a ref on I<contents> until the operation is done. Unlike C<g-file-replace-contents-async()> this allows forgetting about the content without waiting for the callback.

When this operation has completed, I<callback> will be called with I<user-user> data, and the operation can be finalized with C<g-file-replace-contents-finish()>.

  method replace-contents-bytes-async ( N-GObject $contents, Str $etag, Bool $make_backup, self._get-native-object-no-reffing $flags, GCancellable $cancellable, GAsyncReadyCallback $callback, Pointer $user_data )

=item $contents; a B<Gnome::Gio::Bytes>
=item $etag; a new [entity tag][gfile-etag] for the I<file>, or C<undefined>
=item $make_backup; C<True> if a backup should be created
=item $flags; a set of B<Gnome::Gio::FileCreateFlags>
=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 replace-contents-bytes-async ( $contents is copy, Str $etag, Bool $make_backup, self._get-native-object-no-reffing $flags, GCancellable $cancellable, GAsyncReadyCallback $callback, Pointer $user_data ) {
  $contents .= _get-native-object-no-reffing unless $contents ~~ N-GObject;

  g_file_replace_contents_bytes_async(
    self._get-native-object-no-reffing, $contents, $etag, $make_backup, $flags, $cancellable, $callback, $user_data
  );
}

sub g_file_replace_contents_bytes_async (
  N-GFile $file, N-GObject $contents, gchar-ptr $etag, gboolean $make_backup, GFlag $flags, GCancellable $cancellable, GAsyncReadyCallback $callback, gpointer $user_data
) is native(&gio-lib)
  { * }

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

Finishes an asynchronous replace of the given I<file>. See C<replace-contents-async()>. Sets I<new-etag> to the new entity tag for the document, if present.

Returns: C<True> on success, C<False> on failure.

  method replace-contents-finish ( GAsyncResult $res, CArray[Str] $new_etag, N-GError $error --> Bool )

=item $res; a B<Gnome::Gio::AsyncResult>
=item $new_etag; a location of a new [entity tag][gfile-etag] for the document. This should be freed with C<g-free()> when it is no longer needed, or C<undefined>
=item $error; a B<Gnome::Gio::Error>, or C<undefined>
=end pod

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

  g_file_replace_contents_finish(
    self._get-native-object-no-reffing, $res, $new_etag, $error
  ).Bool
}

sub g_file_replace_contents_finish (
  N-GFile $file, GAsyncResult $res, gchar-pptr $new_etag, N-GError $error --> gboolean
) is native(&gio-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
# TM:0:replace-finish:
=begin pod
=head2 replace-finish

Finishes an asynchronous file replace operation started with C<replace-async()>.

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

  method replace-finish ( GAsyncResult $res, N-GError $error --> GFileOutputStream )

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

method replace-finish ( GAsyncResult $res, $error is copy --> GFileOutputStream ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

  g_file_replace_finish(
    self._get-native-object-no-reffing, $res, $error
  )
}

sub g_file_replace_finish (
  N-GFile $file, GAsyncResult $res, N-GError $error --> GFileOutputStream
) is native(&gio-lib)
  { * }
}}

#`{{
#-------------------------------------------------------------------------------
# TM:0:replace-readwrite:
=begin pod
=head2 replace-readwrite

Returns an output stream for overwriting the file in readwrite mode, possibly creating a backup copy of the file first. If the file doesn't exist, it will be created.

For details about the behaviour, see C<replace()> which does the same thing but returns an output stream only.

Note that in many non-local file cases read and write streams are not supported, so make sure you really need to do read and write streaming, rather than just opening for reading or writing.

Returns: a B<Gnome::Gio::FileIOStream> or C<undefined> on error. Free the returned object with C<clear-object()>.

  method replace-readwrite ( Str $etag, Bool $make_backup, self._get-native-object-no-reffing $flags, GCancellable $cancellable, N-GError $error --> GFileIOStream )

=item $etag; an optional [entity tag][gfile-etag] for the current B<Gnome::Gio::File>, or B<NULL> to ignore
=item $make_backup; C<True> if a backup should be created
=item $flags; a set of B<Gnome::Gio::FileCreateFlags>
=item $cancellable; optional B<Gnome::Gio::Cancellable> object, C<undefined> to ignore
=item $error; return location for a B<Gnome::Gio::Error>, or C<undefined>
=end pod

method replace-readwrite ( Str $etag, Bool $make_backup, self._get-native-object-no-reffing $flags, GCancellable $cancellable, $error is copy --> GFileIOStream ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

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

sub g_file_replace_readwrite (
  N-GFile $file, gchar-ptr $etag, gboolean $make_backup, GFlag $flags, GCancellable $cancellable, N-GError $error --> GFileIOStream
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:replace-readwrite-async:
=begin pod
=head2 replace-readwrite-async

Asynchronously overwrites the file in read-write mode, replacing the contents, possibly creating a backup copy of the file first.

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

When the operation is finished, I<callback> will be called. You can then call C<g-file-replace-readwrite-finish()> to get the result of the operation.

  method replace-readwrite-async ( Str $etag, Bool $make_backup, self._get-native-object-no-reffing $flags, Int() $io_priority, GCancellable $cancellable, GAsyncReadyCallback $callback, Pointer $user_data )

=item $etag; an [entity tag][gfile-etag] for the current B<Gnome::Gio::File>, or C<undefined> to ignore
=item $make_backup; C<True> if a backup should be created
=item $flags; a set of B<Gnome::Gio::FileCreateFlags>
=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; (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 replace-readwrite-async ( Str $etag, Bool $make_backup, self._get-native-object-no-reffing $flags, Int() $io_priority, GCancellable $cancellable, GAsyncReadyCallback $callback, Pointer $user_data ) {

  g_file_replace_readwrite_async(
    self._get-native-object-no-reffing, $etag, $make_backup, $flags, $io_priority, $cancellable, $callback, $user_data
  );
}

sub g_file_replace_readwrite_async (
  N-GFile $file, gchar-ptr $etag, gboolean $make_backup, GFlag $flags, int $io_priority, GCancellable $cancellable, GAsyncReadyCallback $callback, gpointer $user_data
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:replace-readwrite-finish:
=begin pod
=head2 replace-readwrite-finish

Finishes an asynchronous file replace operation started with C<replace-readwrite-async()>.

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

  method replace-readwrite-finish ( GAsyncResult $res, N-GError $error --> GFileIOStream )

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

method replace-readwrite-finish ( GAsyncResult $res, $error is copy --> GFileIOStream ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

  g_file_replace_readwrite_finish(
    self._get-native-object-no-reffing, $res, $error
  )
}

sub g_file_replace_readwrite_finish (
  N-GFile $file, GAsyncResult $res, N-GError $error --> GFileIOStream
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:resolve-relative-path:
=begin pod
=head2 resolve-relative-path

Resolves a relative path for I<file> to an absolute path.

This call does no blocking I/O.

Returns: B<Gnome::Gio::File> to the resolved path. C<undefined> if I<relative-path> is C<undefined> or if I<file> is invalid. Free the returned object with C<clear-object()>.

  method resolve-relative-path ( Str $relative_path --> N-GFile )

=item $relative_path; (type filename): a given relative path string
=end pod

method resolve-relative-path ( Str $relative_path --> N-GFile ) {

  g_file_resolve_relative_path(
    self._get-native-object-no-reffing, $relative_path
  )
}

sub g_file_resolve_relative_path (
  N-GFile $file, gchar-ptr $relative_path --> N-GFile
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:set-attribute:
=begin pod
=head2 set-attribute

Sets an attribute in the file with attribute name I<attribute> to I<value>.

Some attributes can be unset by setting I<type> to C<G-FILE-ATTRIBUTE-TYPE-INVALID> and I<value-p> to C<undefined>.

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 attribute was set, C<False> otherwise.

  method set-attribute ( Str $attribute, GFileAttributeType $type, Pointer $value_p, GFileQueryInfoFlags $flags, GCancellable $cancellable, N-GError $error --> Bool )

=item $attribute; a string containing the attribute's name
=item $type; The type of the attribute
=item $value_p; a pointer to the value (or the pointer itself if the type is a pointer type)
=item $flags; a set of B<Gnome::Gio::FileQueryInfoFlags>
=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 set-attribute ( Str $attribute, GFileAttributeType $type, Pointer $value_p, GFileQueryInfoFlags $flags, GCancellable $cancellable, $error is copy --> Bool ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

  g_file_set_attribute(
    self._get-native-object-no-reffing, $attribute, $type, $value_p, $flags, $cancellable, $error
  ).Bool
}

sub g_file_set_attribute (
  N-GFile $file, gchar-ptr $attribute, GEnum $type, gpointer $value_p, GFlag $flags, GCancellable $cancellable, N-GError $error --> gboolean
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:set-attribute-byte-string:
=begin pod
=head2 set-attribute-byte-string

Sets I<attribute> of type C<G-FILE-ATTRIBUTE-TYPE-BYTE-STRING> to I<value>. If I<attribute> is of a different type, this operation will fail, returning C<False>.

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<attribute> was successfully set to I<value> in the I<file>, C<False> otherwise.

  method set-attribute-byte-string ( Str $attribute, Str $value, GFileQueryInfoFlags $flags, GCancellable $cancellable, N-GError $error --> Bool )

=item $attribute; a string containing the attribute's name
=item $value; a string containing the attribute's new value
=item $flags; a B<Gnome::Gio::FileQueryInfoFlags>
=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 set-attribute-byte-string ( Str $attribute, Str $value, GFileQueryInfoFlags $flags, GCancellable $cancellable, $error is copy --> Bool ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

  g_file_set_attribute_byte_string(
    self._get-native-object-no-reffing, $attribute, $value, $flags, $cancellable, $error
  ).Bool
}

sub g_file_set_attribute_byte_string (
  N-GFile $file, gchar-ptr $attribute, gchar-ptr $value, GFlag $flags, GCancellable $cancellable, N-GError $error --> gboolean
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:set-attribute-int32:
=begin pod
=head2 set-attribute-int32

Sets I<attribute> of type C<G-FILE-ATTRIBUTE-TYPE-INT32> to I<value>. If I<attribute> is of a different type, this operation will fail.

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<attribute> was successfully set to I<value> in the I<file>, C<False> otherwise.

  method set-attribute-int32 ( Str $attribute, Int() $value, GFileQueryInfoFlags $flags, GCancellable $cancellable, N-GError $error --> Bool )

=item $attribute; a string containing the attribute's name
=item $value; a B<gint32> containing the attribute's new value
=item $flags; a B<Gnome::Gio::FileQueryInfoFlags>
=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 set-attribute-int32 ( Str $attribute, Int() $value, GFileQueryInfoFlags $flags, GCancellable $cancellable, $error is copy --> Bool ) {
  $error .= _get-native-object-no-reffing unless $error ~~ N-GError;

  g_file_set_attribute_int32(
    self._get-native-object-no-reffing, $attribute, $value, $flags, $cancellable, $error
  ).Bool
}

sub g_file_set_attribute_int32 (
  N-GFile $file, gchar-ptr $attribute, gint32 $value, GFlag $flags, GCancellable $cancellable, N-GError $error --> gboolean
) is native(&gio-lib)
  { * }

#-------------------------------------------------------------------------------
# TM:0:set-attribute-int64:
=begin pod
=head2 set-attribute-int64

Sets I<attribute> of type C<G-FILE-ATTRIBUTE-TYPE-INT64> to I<value>. If I<attribute> is of a different type, this operation will fail.

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<attribute> was successfully set, C<False> otherwise.

  method set-attribute-int64 ( Str $attribute, Int() $value, GFileQueryInfoFlags $flags, GCancellable $cancellable, N-GError $error --> Bool )

=item $attribute; a string containing the attribute's name
=item $value; a B<guint64> containing the attribute's new value
=item $flags; a B<Gnome::Gio::FileQueryInfoFlags>
=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 set-attribute-int64 ( Str $attribute, Int