1. I think you can use unlink to delete a file. Will it serve your purpose.
Extract from man execl.
The const char *arg and subsequent ellipses in the execl, execlp, and execle functions can be thought of as
arg0, arg1, ..., argn. Together they describe a list of one or more pointers to null-terminated strings that
represent the argument list available to the executed program.
The first argument, by convention, should point to the file name associated with the file being executed.
The list of arguments must be terminated by a NULL pointer.
2. The usual syntax i use for execl is
execl ("/bin/rm", "/bin/rm", "/root/test/log", NULL);
Though i am not sure, if what you do is incorrect.