fs_join_path

size_t fs_join_path(char *buf, size_t size, const char *left, const char *right)

Concatenates two paths together with the platform specific separator.

char cwd[MAX_PATH];
if (!fs_current_dir(cwd, MAX_PATH))
{
    print("fs_current_dir failed");
    return;
}

char buf[MAX_PATH];
fs_join_path(buf, MAX_PATH, cwd, "foo.txt");
printf("%s", buf);

Parameters
  • buf[out] Buffer for storing the result path

  • size[in] Buffer size

  • left[in] Left part null-terminated path

  • right[in] Right part null-terminated path

Returns

The number of bytes written to buf.