Re: Strange Error with Glib::ustring



2010/12/19 Gtk MailingList <gtkmailinglistgreesce googlemail com>:
> In this little program i try to replace all spaces in the string with "\ ".
> Because if you use a space character in a path on the command line it
> doesn't work. You must always use "/home/user/some\ directory/second\
> directory" instead of "/home/user/some directory/second directory". Maybe
> you have an better idea to solve this problem.

Use g_spawn_sync() / g_spawn_async() instead of system() to execute
the command line program. The g_spawn family of functions takes a list
of program arguments instead of a command line, so you don't need to
escape any special characters.

Regards, Krzysztof


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]