Sorry for putting a(nother) C question here. But since my goal is to get a widget work, I am humbly posting this, hoping some help.
I am trying to have something like:
Code:
if (gtk_dialog_run(GTK_DIALOG(pdialog)) == GTK_RESPONSE_ACCEPT) {
pdfname = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(pdialog));
}
gtk_entry_set_text(GTK_ENTRY(entrypdf), pdfname);
char pdfinfo[1028];
sprintf(pdfinfo, "pdfinfo %s >filout", pdfname);
g_print("%s", pdfinfo);
system((char *) pdfinfo);
This works fine when the filename choosen has no space. If it has space,
as linux reads it as "file\ with\ space", pdfinfo is giving error.
I cannot open pdfinfo (in my knowledge) with fopen, as then,
Code:
sprintf(pdfinfo, "pdfinfo %s >filout", pdfname);
will give error, as I am printing a FILE as char.
what is the wayout?