File: fopenf.c

package info (click to toggle)
libite 2.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,920 kB
  • sloc: sh: 4,463; ansic: 3,660; makefile: 111
file content (18 lines) | stat: -rw-r--r-- 235 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "check.h"

int main(void)
{
	FILE *fp;
	char *dir = "/tmp";
	char *file = "__foo__";

	fp = fopenf("w", "%s/%s", dir, file);
	if (fp) {
		fputs("foo", fp);
		fclose(fp);
	}

	fail_unless(fexist("/tmp/__foo__"));

	return 0;
}