Is there some C library that implements platform independent version of path operations?
Some examples that come to mind:
There are of course platform specific versions of these, but they hardly ever do exactly the same thing leading to chaos trying to match behaviour across platforms.
And I mean C, not C++, so boost doesn't count.
Also if there is none, are there any good sources/examples of differences between platforms, and other useful information that can be used to write such a library?
I know this is a rather old question, but I have been looking for something like this and couldn't find anything. So I wrote one, cwalk (reference) - for anyone who still finds it useful! :-)
The ever-nice glib family (part of GTK+) has some, at least.
g_path_is_absolute() and othersg_file_make_directory_with_parents().Note that some of the functions you're describing, such as "getting absolute path from relative one" assumes the existence of a current directory, which is how that resolution is typically done. It's not a very "pure" function, since it relies on external state. In Windows, with its "split file system", there is even one current directory per volume (e.g. one for C:\, one for A:\ if you have it, and so on) per process.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With