You can also try xdmp:filesystem-directory
declare namespace dir="http://marklogic.com/xdmp/directory"
if(fn:exists(xdmp:filesystem-directory("/<FILE-PATH>")//dir:entry[dir:filename
= '<FILENAME>']/dir:filename))
then ("exists")
else ()
Vidhya
Eric Palmitesta wrote:
Shorter version of my question: is there a file-system equivalent of
the fn:doc-available function?
Eric
Eric Palmitesta wrote:
Hi all,
Hopefully I'm missing something and someone can put me on the right
track.
It's fine to say "if (exists(doc('blah'))) then" because doc will
simply return () rather than producing an error. How do I do the
same with xdmp:document-get? Since xdmp:document-get errors with
"file not found" (if a file is indeed not found), I was hoping to
check if the call will fail before I make it. The xdmp:uri-is-file
function looks like the wrong one to use, though, because an absolute
path means something different:
The api for xdmp:document-get says
"On the filesystem, the path can be fully qualifed or relative.
Relative pathnames are resolved from the directory in which MarkLogic
Server is installed."
The api for xdmp:uri-is-file says
says "If the URI begins with a '/', it is relative to the root
directory of the application server."
Is a try/catch the only way?
Thanks,
Eric
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general
begin:vcard
fn:Vidhya Arvind
n:Arvind;Vidhya
org:University of Toronto Libraries;Ontario Council of University Libraries - Scholarsportal Project
title:Application Programmer Analyst
tel;work:(416) 946-0300
tel;fax:(416) 978-1668
version:2.1
end:vcard
_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general