Closed ilobilo closed 2 years ago
Hi @ilobilo ! You should be able to achieve this already with the current API. Using your example:
size_t length = cwk_path_get_absolute("/hello/", "/world", NULL, 0) + 1; // 6 + 1 = 7
char *buffer = malloc(length);
cwk_path_get_absolute("/hello/", "/world", buffer, length);
printf("Path: %s", buffer); // "/world"
Does that help you?
yes that works, thank you!
cool project btw
awesome! thanks for your feedback!
Add support to just return absolute path length so i can allocate exact amount of memory in an array
this would return 6 then i would allocate 6 + 1 bytes to a char array example usage:
Same for relative