Just a quick note that the doc seems out of sync with reality :)

doc for xdmp:directory-create()
http://developer.marklogic.com/pubs/4.1/apidocs/UpdateBuiltins.html#xdmp:directory-create

"Creates a directory. If security is enabled, the document permissions
and collections are set to the given parameters, if supplied.
Otherwise, the current user's default permissions and/or collections
are applied. If the beginning of the the document URI is protected,
the user must have access to that URI privilege. If the directory URI
does not end with a '/' one is added. *If the directory already
exists, then nothing is done*."

release notes:
http://developer.marklogic.com/pubs/4.1/books/relnotes.pdf

"In 4.1, if you try to create a directory (using
xdmp:directory-create, for example) and the
directory already exists, then an exception is thrown
(XDMP-DIREXISTS). In 4.0, the directory was
re-created, and no exception was thrown. If you have code that relies
on the old behavior, you
must modify that code to make it handle the exception when the
directory exists."

As there doesn't seem to be a xdmp:directory-exists() function (could
fn:exists() be used?), what's the "correct" way to avoid exceptions
been thrown?  I'm currently using try/catch.

cheers,
Jakob.
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to