There should be something elegant in Linux API/POSIX to extract base file name from full path
My example (improved):
#include const char* getFileNameFromPath(const char* path, char separator = '/') { if(path != nullptr) { for(size_t i = strlen(path); i > 0; --i) { if (path[i-1] == separator) { return &path[i]; } } } return path; }