42-archive/42sh/42shelltest-tmp/support/delete-file
2017-03-18 01:30:28 +01:00
..
description 42shelltester 2017-03-18 01:30:28 +01:00
main.c 42shelltester 2017-03-18 01:30:28 +01:00
Makefile 42shelltester 2017-03-18 01:30:28 +01:00
README.md 42shelltester 2017-03-18 01:30:28 +01:00

./delete_file

A binary that delete all files called in argument.

#include <stdlib.h>
#include <strings.h>
#include <limits.h>
#include <stdio.h>

int	main(int argc, char **argv)
{
	char	buf[PATH_MAX + 1];
	
	while (argc > 0)
	{
		bzero(buf, PATH_MAX + 1);
		realpath(argv[argc--], buf);
		remove(buf);
	}	
	return (0);
}