Created
June 11, 2024 23:43
-
-
Save jeansymolanza/fc71f2db94b54aab8a3e0268d5deb7e7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
while (!stop_requested) { | |
if (access(STOP_FILE, F_OK) != -1) { | |
// Stop file exists | |
printf("Stop file found at %s. Deleting the file and stopping the script.\n", STOP_FILE); | |
// Delete the stop file | |
if (remove(STOP_FILE) == 0) { | |
printf("Stop file deleted successfully.\n"); | |
} else { | |
fprintf(stderr, "Failed to delete stop file: %s\n", strerror(errno)); | |
} | |
// Exit the loop | |
break; | |
} | |
// ... (rest of the code remains the same) | |
} | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment