For the following .cpp program, change the content such that itappends ‘a’ to every file and directory name recursively in thecurrent working directory and sub directories.
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <limits.h> // for PATH_MAX
#include <string.h>
/* function type that is called for each filename */
typedef int Myfunc(const char *, const struct stat *, int);
static Myfunc myfunc;
static int myftw(char *, Myfunc *);
static int dopath(Myfunc *);
static long nreg, ndir, nblk, nchr, nfifo, nslink, nsock,ntot;
int
main(int argc, char *argv[])
{
int ret;
if (argc != 2)
printf (“usage: ftw <starting-pathname>”);
ret = myftw(argv[1], myfunc); /* does it all */
ntot = nreg + ndir + nblk + nchr
PayPal Gateway not configured
PayPal Gateway not configured