GNOME Bugzilla – Bug 437977
Need to know the additional length used in the template by g_file_set_contents()
Last modified: 2010-08-26 03:58:13 UTC
g_file_set_contents() first creates a %s.XXXXXX filename. This adds 7 characters to the filename that will be written, and it can cause the write to file because it the filename passed by the user has a size of NAME_MAX (and thus the temp filename is longer than NAME_MAX). So the length of ".XXXXXX" needs to be taken into account by the caller. We're not supposed to know that it's 7, so having a #define for this would be great.
I'd accept a patch to make g_file_set_contents() shorten the name as necessary when creating the temporary name. But I don't think that the number 7 is a big secret, and I wouldn't hestitate using that knowledge if I were you.