X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gio%2Fgfile.c;h=3e2607c8dee2bfd12413dbdc4d61793e5cd4f946;hb=853692bdfd9f8a87aed70d21f643dc13b57c92d1;hp=61ddaaccd6212c6a8fdaf0f40bce150ef58a5c98;hpb=03b510fde17b130dd7273cee6a65e2d54ff85fff;p=platform%2Fupstream%2Fglib.git diff --git a/gio/gfile.c b/gio/gfile.c index 61ddaac..3e2607c 100644 --- a/gio/gfile.c +++ b/gio/gfile.c @@ -641,7 +641,7 @@ g_file_hash (gconstpointer file) * @file1: the first #GFile * @file2: the second #GFile * - * Checks equality of two given #GFiles. + * Checks if the two given #GFiles refer to the same file. * * Note that two #GFiles that differ can still refer to the same * file on the filesystem due to various forms of filename @@ -660,6 +660,9 @@ g_file_equal (GFile *file1, g_return_val_if_fail (G_IS_FILE (file1), FALSE); g_return_val_if_fail (G_IS_FILE (file2), FALSE); + if (file1 == file2) + return TRUE; + if (G_TYPE_FROM_INSTANCE (file1) != G_TYPE_FROM_INSTANCE (file2)) return FALSE; @@ -810,6 +813,9 @@ g_file_get_child_for_display_name (GFile *file, * 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 @@ -1718,14 +1724,14 @@ g_file_create (GFile *file, * operation was cancelled, the error %G_IO_ERROR_CANCELLED will be * returned. * - * If you pass in a non-%NULL @etag value, then this value is - * compared to the current entity tag of the file, and if they differ - * an %G_IO_ERROR_WRONG_ETAG error is returned. This generally means - * that the file has been changed since you last read it. You can get - * the new etag from g_file_output_stream_get_etag() after you've - * finished writing and closed the #GFileOutputStream. When you load - * a new file you can use g_file_input_stream_query_info() to get - * the etag of the file. + * If you pass in a non-%NULL @etag value and @file already exists, then + * this value is compared to the current entity tag of the file, and if + * they differ an %G_IO_ERROR_WRONG_ETAG error is returned. This + * generally means that the file has been changed since you last read + * it. You can get the new etag from g_file_output_stream_get_etag() + * after you've finished writing and closed the #GFileOutputStream. When + * you load a new file you can use g_file_input_stream_query_info() to + * get the etag of the file. * * If @make_backup is %TRUE, this function will attempt to make a * backup of the current file before overwriting it. If this fails