// "lib-fappend-test-a.hac"
// copy-modified from "lib-fappend-test-a.hac"
//	$Id: lib-fappend-test-a.hac,v 1.2 2007/08/28 04:54:56 fang Exp $
// testing printing to file, and closing, and dumping

int c;
chp {
	// wipe the file first
{fopen("lib-fappend-test-a-out.txt");
fclose("lib-fappend-test-a-out.txt")},
c := 0;
*[ (c < 3) ->
	fappend("lib-fappend-test-a-out.txt");
	fprint("lib-fappend-test-a-out.txt",
		"welcome to libc!\n");
	fprint("lib-fappend-test-a-out.txt",
		28, " is a perfect number.\n");
	fprint("lib-fappend-test-a-out.txt",
		"To thine own self be ", true, ".\n");
	fclose("lib-fappend-test-a-out.txt");
	c := c+1
];
	// expect triplicate
	system("cat lib-fappend-test-a-out.txt")
}

