File Utilities
<!-- ##### SECTION Short_Description ##### -->
-various file-related functions.
+various file-related functions
<!-- ##### SECTION Long_Description ##### -->
<para>
+There is a group of functions which wrap the common POSIX functions
+dealing with filenames (g_open(), g_rename(), g_mkdir(), g_stat(),
+g_unlink(), g_remove(), g_fopen(), g_freopen()). The point of these
+wrappers is to make it possible to handle file names with any Unicode
+characters in them on Windows without having to use ifdefs and the
+wide character API in the application code.
+</para>
+<para>
+The pathname argument should be in the GLib file name encoding. On
+POSIX this is the actual on-disk encoding which might correspond to
+the locale settings of the process (or the
+<envar>G_FILENAME_ENCODING</envar> environment variable), or not.
+</para>
+<para>
+On Windows the GLib file name encoding is UTF-8. Note that the
+Microsoft C library does not use UTF-8, but has separate APIs for
+current system code page and wide characters (UTF-16). The GLib
+wrappers call the wide character API if present (on modern Windows
+systems), otherwise convert to/from the system code page.
+</para>
+<para>
+Another group of functions allows to open and read directories
+in the GLib file name encoding. These are g_dir_open(),
+g_dir_read_name(), g_dir_rewind(), g_dir_close().
</para>
<!-- ##### SECTION See_Also ##### -->
</para>
+<!-- ##### SECTION Stability_Level ##### -->
+
+
<!-- ##### ENUM GFileError ##### -->
<para>
Values corresponding to <literal>errno</literal> codes returned from file operations
@G_FILE_ERROR_PERM: Operation not permitted; only the owner of the
file (or other resource) or processes with special privileges can
perform the operation.
+@G_FILE_ERROR_NOSYS: Function not implemented; this indicates that the
+ system is missing some functionality.
@G_FILE_ERROR_FAILED: Does not correspond to a UNIX error code; this
is the standard "failed for unspecified reason" error code present in
all #GError error code enumerations. Returned if no specific
<!-- ##### ENUM GFileTest ##### -->
<para>
-A test to perform an a file using g_file_test().
+A test to perform on a file using g_file_test().
</para>
-@G_FILE_TEST_IS_REGULAR: %TRUE if the file is a regular file (not a symlink or directory)
+@G_FILE_TEST_IS_REGULAR: %TRUE if the file is a regular file (not a directory).
+ Note that this test will also return %TRUE if the tested file is a symlink
+ to a regular file.
@G_FILE_TEST_IS_SYMLINK: %TRUE if the file is a symlink.
@G_FILE_TEST_IS_DIR: %TRUE if the file is a directory.
@G_FILE_TEST_IS_EXECUTABLE: %TRUE if the file is executable.
-@G_FILE_TEST_EXISTS: %TRUE if the file exists. It may or may not be a regular file.
+@G_FILE_TEST_EXISTS: %TRUE if the file exists.
+ It may or may not be a regular file.
<!-- ##### FUNCTION g_file_error_from_errno ##### -->
<para>
@Returns:
+<!-- ##### FUNCTION g_file_set_contents ##### -->
+<para>
+
+</para>
+
+@filename:
+@contents:
+@length:
+@error:
+@Returns:
+
+
<!-- ##### FUNCTION g_file_test ##### -->
<para>
@Returns:
+<!-- ##### FUNCTION g_file_read_link ##### -->
+<para>
+
+</para>
+
+@filename:
+@error:
+@Returns:
+
+
+<!-- ##### FUNCTION g_mkdir_with_parents ##### -->
+<para>
+
+</para>
+
+@pathname:
+@mode:
+@Returns:
+
+
<!-- ##### STRUCT GDir ##### -->
<para>
An opaque structure representing an opened directory.
@dir:
+<!-- ##### STRUCT GMappedFile ##### -->
+<para>
+The #GMappedFile represents a file mapping created with
+g_mapped_file_new(). It has only private members and should
+not be accessed directly.
+</para>
+
+
+<!-- ##### FUNCTION g_mapped_file_new ##### -->
+<para>
+
+</para>
+
+@filename:
+@writable:
+@error:
+@Returns:
+
+
+<!-- ##### FUNCTION g_mapped_file_ref ##### -->
+<para>
+
+</para>
+
+@file:
+@Returns:
+
+
+<!-- ##### FUNCTION g_mapped_file_unref ##### -->
+<para>
+
+</para>
+
+@file:
+
+
+<!-- ##### FUNCTION g_mapped_file_free ##### -->
+<para>
+
+</para>
+
+@file:
+
+
+<!-- ##### FUNCTION g_mapped_file_get_length ##### -->
+<para>
+
+</para>
+
+@file:
+@Returns:
+
+
+<!-- ##### FUNCTION g_mapped_file_get_contents ##### -->
+<para>
+
+</para>
+
+@file:
+@Returns:
+
+
+<!-- ##### FUNCTION g_open ##### -->
+<para>
+
+</para>
+
+@filename:
+@flags:
+@mode:
+@Returns:
+
+
+<!-- ##### FUNCTION g_rename ##### -->
+<para>
+
+</para>
+
+@oldfilename:
+@newfilename:
+@Returns:
+
+
+<!-- ##### FUNCTION g_mkdir ##### -->
+<para>
+
+</para>
+
+@filename:
+@mode:
+@Returns:
+
+
+<!-- ##### FUNCTION g_stat ##### -->
+<para>
+
+</para>
+
+@filename:
+@buf:
+@Returns:
+
+
+<!-- ##### FUNCTION g_lstat ##### -->
+<para>
+
+</para>
+
+@filename:
+@buf:
+@Returns:
+
+
+<!-- ##### FUNCTION g_unlink ##### -->
+<para>
+
+</para>
+
+@filename:
+@Returns:
+
+
+<!-- ##### FUNCTION g_remove ##### -->
+<para>
+
+</para>
+
+@filename:
+@Returns:
+
+
+<!-- ##### FUNCTION g_rmdir ##### -->
+<para>
+
+</para>
+
+@filename:
+@Returns:
+
+
+<!-- ##### FUNCTION g_fopen ##### -->
+<para>
+
+</para>
+
+@filename:
+@mode:
+@Returns:
+
+
+<!-- ##### FUNCTION g_freopen ##### -->
+<para>
+
+</para>
+
+@filename:
+@mode:
+@stream:
+@Returns:
+
+
+<!-- ##### FUNCTION g_chmod ##### -->
+<para>
+
+</para>
+
+@filename:
+@mode:
+@Returns:
+
+
+<!-- ##### FUNCTION g_access ##### -->
+<para>
+
+</para>
+
+@filename:
+@mode:
+@Returns:
+
+
+<!-- ##### FUNCTION g_creat ##### -->
+<para>
+
+</para>
+
+@filename:
+@mode:
+@Returns:
+
+
+<!-- ##### FUNCTION g_chdir ##### -->
+<para>
+
+</para>
+
+@path:
+@Returns:
+
+
+<!-- ##### FUNCTION g_utime ##### -->
+<para>
+
+</para>
+
+@filename:
+@utb:
+@Returns:
+
+