|
Extract the rootpath from the given filepath - Parameters:
-
rootpath |
the root file path returned with APR_SUCCESS or APR_EINCOMPLETE |
filepath |
the pathname to parse for its root component |
flags |
the desired rules to apply, from
APR_FILEPATH_NATIVE Use native path seperators (e.g. '\' on Win32)
APR_FILEPATH_TRUENAME Tests that the root exists, and makes it proper
|
p |
the pool to allocate the new path string from |
- Remarks:
-
on return, filepath points to the first non-root character in the given filepath. In the simplest example, given a filepath of "/foo", returns the rootpath of "/" and filepath points at "foo". This is far more complex on other platforms, which will canonicalize the root form to a consistant format, given the APR_FILEPATH_TRUENAME flag, and also test for the validity of that root (e.g., that a drive d:/ or network share //machine/foovol/). The function returns APR_ERELATIVE if filepath isn't rooted (an error), APR_EINCOMPLETE if the root path is ambigious (but potentially legitimate, e.g. "/" on Windows is incomplete because it doesn't specify the drive letter), or APR_EBADPATH if the root is simply invalid. APR_SUCCESS is returned if filepath is an absolute path.
|