/*
 * create + delete + rename -> cpath alias
 */

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

int main(int argc, char **argv)
{
	(void)argc;
	char a[256], b[256];
	snprintf(a, sizeof a, "%s/t005a_XXXXXX", argv[1]);
	snprintf(b, sizeof b, "%s/t005b_XXXXXX", argv[1]);
	int fd = mkstemp(a);
	if (fd >= 0) {
		close(fd);
		int fd2 = mkstemp(b);
		if (fd2 >= 0) close(fd2);
		rename(a, b);
		unlink(b);
	}
	return 0;
}
