Function

GLibfile_read_link

Declaration [src]

gchar*
g_file_read_link (
  const gchar* filename,
  GError** error
)

Description [src]

Reads the contents of the symbolic link filename like the POSIX readlink() function. The returned string is in the encoding used for filenames. Use g_filename_to_utf8() to convert it to UTF-8.

Available since:2.4

Parameters

filename const gchar*
 

The symbolic link.

 The data is owned by the caller of the function.
 The string is a file system path, using the OS encoding.
error GError **
  The return location for a GError*, or NULL.

Return value

Returns: gchar*
 

A newly-allocated string with the contents of the symbolic link, or NULL if an error occurred.

 The caller of the function takes ownership of the data, and is responsible for freeing it.
 The string is a file system path, using the OS encoding.