use unlink() for files only and rmdir() for directories