File did not save

Hey,
I wrote a little program in C to save some datas to a txt file. I post my code below:

void anyfunction(){
	FILE *fp;

	char *buf = app_get_shared_data_path();
	//app_get_shared_trusted_path()

	//char *buf = "/home/owner/apps_rw/org.example.uhrstruct/shared/data/";
	char *buf2 = "test.txt";
	buf = strcat(buf, buf2);
	fp = fopen(buf, "w");

	fputs("Hello", fp);

	fclose(fp);
}

I think that should work fine, but the file did not save. I tried several different directions but it did not worked in any case.
I added these privileges:
-http://tizen.org/privilege/mediastorage
-http://tizen.org/privilege/filesystem.write
-http://tizen.org/privilege/filesystem.read
Have somreone a idea what I am doing wrong?
Best regards, Marcel

Hello,
Would you please have a look into this link? I think this question has the same query as yours.
Thank you.