Is there any cross platform file IO / path util library for C? -
is there c library implements platform independent version of path operations?
some examples come mind:
- getting absolute path relative 1 (without requiring file exist)
- ensuring directory exists.
- creating file if non-existent, , directory in given path missing.
- concatenating paths.
- getting directory part of path.
- getting filename part of path.
- lots more....
there of course platform specific versions of these, hardly ever same thing leading chaos trying match behaviour across platforms.
and mean c, not c++, boost doesn't count.
also if there none, there sources/examples of differences between platforms, , other useful information can used write such library?
the ever-nice glib family (part of gtk+) has some, @ least.
- the misc utility functions api has functions
g_path_is_absolute(), others - the i/o virtualization wrapper api gio has
g_file_make_directory_with_parents().
note of functions you're describing, such "getting absolute path relative one" assumes existence of current directory, how resolution typically done. it's not "pure" function, since relies on external state. in windows, "split file system", there 1 current directory per volume (e.g. 1 c:\, 1 a:\ if have it, , on) per process.
Comments
Post a Comment