Web lists-archives.com

Re: trouble with g_stat




On 06/04/2018 04:27 AM, GaryW wrote:
Both of the following examples compile ok, but while this works:

//------------------

GString *fspec;

struct stat sB;

//fspec->str tested to hold the correct file spec…

if(stat(fspec->str,&sB)>0){… [as expected]

this doesn’t:

//------------------

GString *fspec;

GStatBuf *stBuf;

//fspec->str tested to hold the correct file spec…

if(g_stat(fspec->str,stBuf)<0){… [9476 Segmentation fault]

I’ve tried tinkering with various permutations, but nothing else compiles.

Have you tried:

GString *fspec;
GStatBuf stBuf;
if (g_stat(fspec->str, &stBuf) < 0) ...

That's how you use regular stat, after all.
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list