Method

GioFileget_relative_path

Declaration

char*
g_file_get_relative_path (
  GFile* parent,
  GFile* descendant
)

Description

Gets the path for descendant relative to parent.

This call does no blocking I/O.

Parameters

descendant

Type: GFile

Input GFile.

The data is owned by the caller of the function.

Return value

Type: char*

String with the relative path from descendant to parent, or NULL if descendant doesn’t have parent as prefix. The returned string should be freed with g_free() when no longer needed.

The caller of the method takes ownership of the data, and is responsible for freeing it.
The return value can be NULL.
The value is a file system path, using the OS encoding.