GFileEnumerator: Add some documentation about ordering
authorColin Walters <walters@verbum.org>
Wed, 5 Jun 2013 22:05:12 +0000 (18:05 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 9 Jun 2013 22:17:05 +0000 (18:17 -0400)
Kind of a gratuitious gaping hole in the docs...

https://bugzilla.gnome.org/show_bug.cgi?id=701680

gio/gfileenumerator.c

index d2779ce..b87335c 100644 (file)
  * version will return a list of #GFileInfo<!---->s, whereas the 
  * synchronous will only return the next file in the enumerator.
  *
+ * The ordering of returned files is unspecified for non-Unix
+ * platforms; for more information, see g_dir_read_name().  On Unix,
+ * when operating on local files, returned files will be sorted by
+ * inode number.  Effectively you can assume that the ordering of
+ * returned files will be stable between successive calls (and
+ * applications) assuming the directory is unchanged.
+ *
+ * If your application needs a specific ordering, such as by name or
+ * modification time, you will have to implement that in your
+ * application code.
+ *
  * To close a #GFileEnumerator, use g_file_enumerator_close(), or 
  * its asynchronous version, g_file_enumerator_close_async(). Once 
  * a #GFileEnumerator is closed, no further actions may be performed 
@@ -180,6 +191,9 @@ g_file_enumerator_init (GFileEnumerator *enumerator)
  * returned from this function will contain attributes that match the 
  * attribute string that was passed when the #GFileEnumerator was created.
  *
+ * See the documentation of #GFileEnumerator for information about the
+ * order of returned files.
+ *
  * On error, returns %NULL and sets @error to the error. If the
  * enumerator is at the end, %NULL will be returned and @error will
  * be unset.
@@ -311,6 +325,9 @@ next_async_callback_wrapper (GObject      *source_object,
  * Request information for a number of files from the enumerator asynchronously.
  * When all i/o for the operation is finished the @callback will be called with
  * the requested information. 
+
+ * See the documentation of #GFileEnumerator for information about the
+ * order of returned files.
  *
  * The callback can be called with less than @num_files files in case of error
  * or at the end of the enumerator. In case of a partial error the callback will