Hi,
For a while I wasn't aware, then I noticed it and then I got annoyed by it. It's not a big issue but it does require extra code to work around this, in my opinion, annoying behaviour.
When using file:resolve-path it depends if the file exists or not. The output is different.
Say I have an existing directory F:\tmp then
file:resolve-path('F:/tmp') => F:\tmp\
However, when I have a path that points to a non-existing directory (or file, we cannot know!)
file:resolve-path('F:/tmp/not-exists') => F:/tmp/not-exists
Notice the absence of a slash. I guess the assumption that is made is that in the future this will refer to a file and not a directory.
The same behaviour occurs with file:path-to-uri(), and file:base-dir() also returns a path with a trailing slash.
I think that this is annoying, or let's say at least, inconsistent behaviour and had me add code that defensively strips of trailing slash. I cannot rely on file:resolve-path results because if a directory doesn't exist it has no slash at the end, and if it does it has and sometimes I don't want to check for existence at that point. When combining paths I tend to use string-join($parts,'/') and having slash at the end of URL's and filesystem paths doesn't feel right so I always strip them off.
Hope I didn't sound too grumpy ;-) Opinions? Guess, changing it would trip up a lot of existing path handling code.
--Marc