C programming, are there any good ways to manage path strings rather than using C string API like strcat on linux? The equivalent of Windows’ PathAppend would be great. Thank you!
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here’s a quick-n-dirty, next-to-untested version that concatenates paths with a Unix-friendly ‘/’ separator between the two:
Note that in my opinion this function should have a parameter that indicates the destination size. I also didn’t implement the documented functionality that Win32 has of removing “.” and “..” components at the start of the path (why is that there?).
Also, what would cause Win32’s
PathAppend()to return failure?Use (and/or modify) at your own risk…