Re: "Failed to open file 'Hp\u0008\u0008': No such file or directory."



Am Donnerstag, den 01.06.2006, 15:51 +0200 schrieb Stefano Esposito:

this code gives me the error from the subject (or someone equivalent).
Any hint would be greatly appreciated.

...
int open_file (gchar *fname, gchar *text)
{
  /*fname is the return value of gtk_file_chooser_get_filename, used
on a gtk_file_chooser_dialog*/
  GError *error = NULL;
  gchar *tmp_text;

  if (!g_file_get_contents (glib_fname, &tmp_text, NULL, &error))

Where does glib_fname come from? Maybe it is a static or a global
variable declared outside the function? Maybe you could also post the
lines before the open_file invocation?

    {
      g_warning ("%s. File not red", error->message);
      return 0;
    }

  if(!g_utf8_validate (tmp_text, -1, NULL))
    {
      text = g_locale_to_utf8 (tmp_text, -1, NULL, NULL, &error);
      if (error != NULL)
        {
          g_warning ("%s. File not red", error->message);
          return 0;       
        }
    }
  else
    {
      text = tmp_text;
    }
  return 1;
} 
-- 
Christian Neumair <chris gnome-de org>




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