The library was originally a Lua wrapper module called 'iox' on top of
the Windows shlwapi.dll. All of those APIs used the term "path", which
could refer to a directory name or filename. Therefore, I'm not sure
referring to just a filename is sufficient. Python has a library for
pathname manipulation called os.path, too.
* os.path.append(leftPath, rightPath): Appends leftPath and rightPath
together, adding a slash between the two path components. If rightPath
is an absolute path, it is not appended to leftPath and is returned
directly.
* os.path.combine(leftPath, rightPath): Combines leftPath and rightPath,
adding a slash between the two path components and simplifying the path
by collapsing . and .. directories. If rightPath is an absolute path, it
is not appended to leftPath and is returned directly.
These seem slightly confusing, as they sort of refer to the physical
composition of the filename, rather than the abstract operation that's
happening (making a _truly_ portable filename library is pretty hard,
but I think it's good to try and at least operate at a slightly higher
level of abstraction than talking about slashes etc).
The os.path functions work on Windows, Mac OS X, and Unix platforms.
Forward slashes can be used as directory separators on all.
What common platforms did you have in mind?
[