/*
 * write + truncate -> wpath alias
 */

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>

int main(int argc, char **argv)
{
	(void)argc;
	char t[256];
	snprintf(t, sizeof t, "%s/t004_XXXXXX", argv[1]);
	int fd = mkstemp(t);
	if (fd >= 0) {
		write(fd, "hello world", 11);
		ftruncate(fd, 5);
		close(fd);
		unlink(t);
	}
	return 0;
}
