mardi 25 juin 2019

How to check filename and variable name are same

Actually, the problem is, When system getting upgrade it should write "DISABLE_BACKUP" file in root directory. When it comes up, i have to check whether the file has been in root or not.

    if ((dir = opendir ("/"))!=NULL)
    {
        while ((ent = readdir(dir)) != NULL)
        {
            printf ("%s\n", ent->d_name);

        //Here i have to compare the filename (DISABLE_BACKUP) with the string "DISABLE_BACKUP" and has to raise log entry.
        }
    closedir(dir);
    }

Aucun commentaire:

Enregistrer un commentaire