31 strlcpy(buf, path, (str-path) + 1);
C size_t strlcpy(char *dst, const char *src, size_t siz)
Copy src to string dst of size siz.
C char * strrchr(const char *s, int c)
String scanning operation.
char * dirname(char *path)
Return the directory portion of a pathname.
#define PATH_MAX
Maximum file path length.