Virtual Method

GioFileprefix_matches

Declaration [src]

gboolean
prefix_matches (
  GFile* prefix,
  GFile* file
)

Description [src]

Checks whether file has the prefix specified by prefix.

In other words, if the names of initial elements of files pathname match prefix. Only full pathname elements are matched, so a path like /foo is not considered a prefix of /foobar, only of /foo/bar.

A GFile is not a prefix of itself. If you want to check for equality, use g_file_equal().

This call does no I/O, as it works purely on names. As such it can sometimes return FALSE even if file is inside a prefix (from a filesystem point of view), because the prefix of file is an alias of prefix.

Parameters

file

Type: GFile

Input GFile.

The data is owned by the caller of the method.

Return value

Type: gboolean

TRUE if the files parent, grandparent, etc is prefix, FALSE otherwise.