Function

GioFilenew_for_uri

Declaration

GFile*
g_file_new_for_uri (
  const char* uri
)

Description

Constructs a GFile for a given URI. This operation never fails, but the returned object might not support any I/O operation if uri is malformed or if the uri type is not supported.

Parameters

uri

Type: const char*

A UTF-8 string containing a URI.

The data is owned by the caller of the function.
The value is a NUL terminated UTF-8 string.

Return value

Type: GFile

A new GFile for the given uri. Free the returned object with g_object_unref().

The caller of the function takes ownership of the data, and is responsible for freeing it.