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



Hi all,

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

Thanks
Stefano


...
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))
    {
      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;
}
...

-- 
"Solo due cose sono infinite: l'universo e la stupidità umana... e per quanto riguarda l'universo non sono 
sicuro"

Albert Einstein

# GnuPG/PGP Key Id: 0x5646B7D4


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