Ah, never mind. When I run the file:write-text() without jobs:eval(), I get an error, "Cannot convert xs:dateTime to xs:string." Is it possible to return the error from a job call?

TIm

--
Tim A. Thompson
Metadata Librarian
Yale University Library

On Sat, Feb 6, 2021 at 10:00 AM Tim Thompson <timathom@gmail.com> wrote:
Hello,

I was experimenting with the jobs module and wondering why there's a difference between file:write() and file:write-text() in the query below:

for $i in 1 to 5
return (
  jobs:eval('
    declare variable $iter external;
    file:write-text("~/Desktop/job"|| $iter ||".txt", (prof:sleep(5000), string(current-dateTime())))
    ', map {"iter": $i}
  )
)

With file:write-text(), if I don't wrap current-dateTime() in string(), nothing is written and no files are created. With file:write(), text is always written and files always get created.

Thanks!
Tim


--
Tim A. Thompson
Metadata Librarian
Yale University Library