On Mon, 2024-04-22 at 08:00 +0200, Imsieke, Gerrit, le-tex wrote:
I have a file:// URI that corresponds to a directory that I need to create (using svn mkdir, therefore file:create-dir() is not an option here) if it doesn’t exist. Calling file:path-to-native() on it results in a file:not-found error. Is there a fundamental reason why the file needs to exist before transforming its URI into the OS- native representation? Using BaseX 10.7.
First, as you prolly saw, the spec does say it's an error if the file does not exist.
Second, it behaves differently if it points to a directory than if it points to a file, and symbolic links are resolved.
But i agree there doesn't seem a reason for it to be an error if the file isn't there, except to the extent that it doesn't know whether to append the file separator for a directory...
It’s documented as non-deterministic, though, so that's OK.
liam
[1] http://expath.org/spec/file#fn.path-to-native