Package: gio

Function g-file-new-for-commandline-arg

Lambda List

g-file-new-for-commandline-arg (arg)

Arguments

arg -- a command line string

Return Value

A new g-file object.

Details

Creates a g-file object with the given argument from the command line. The value of the arg argument can be either a URI, an absolute path or a relative path resolved relative to the current working directory. This operation never fails, but the returned object might not support any I/O operation if the arg argument points to a malformed path.

Note that on Windows, this function expects its argument to be in UTF-8 -- not the system code page. This means that you should not use this function with string from the argv parameter as it is passed to the main function. The g_win32_get_command_line() function will return a UTF-8 version of the command line. The g-application class also uses UTF-8 but the g-application-command-line-create-file-for-arg function may be more useful for you there. It is also always possible to use this function with g-option-context instances of :filename type.
 

See also

2021-10-8