Function

GioFilenew_for_path

Declaration

GFile*
g_file_new_for_path (
  const char* path
)

Description

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

Parameters

path

Type: const char*

A string containing a relative or absolute path. The string must be encoded in the glib filename encoding.

The data is owned by the caller of the function.
The value is a file system path, using the OS encoding.

Return value

Type: GFile

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

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