[ CCode ( vfunc_name = "prefix_matches" ) ]
public abstract bool has_prefix (File file)
Checks whether this has the prefix specified by prefix
.
In other words, if the names of initial elements of this's 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 File is not a prefix of itself. If you want to check for equality, use equal.
This call does no I/O, as it works purely on names. As such it can sometimes return false even if
this is inside a prefix
(from a filesystem point of view), because the prefix of
this is an alias of prefix
.
this |
input File |
prefix |
input File |
true if the this's parent, grandparent, etc is |