# Arara reports an error when encountering the method writeToFile

Consider the following LaTeX document that starts with an Arara script consisting of a single directive that is spread across 5 lines.

% arara: halt if
% arara: --> exists(toFile('arara.file.temp'))
% arara: --> && (writeToFile('arara.var.doesTempExist', 't', false) || true)
% arara: --> ||
% arara: --> writeToFile('arara.var.doesTempExist', 'f', false)
\documentclass{article}
\begin{document}
Hello, world!
\end{document}


The intention behind the script is for it to check whether a file named arara.file.temp exists. If so, the string t should be written to the file arara.var.doesTempExist. If not, the string f should be written to the same file.

The directive halt is described on p. 113 of the Arara user guide (v. 4.0), the method exists is described on p. 61, the method toFile is described on p. 59, and the method writeToFile is described on p. 66 (mind that it is said to return a boolean and never to raise an exception).

When I run this script by executing arara test2 from the command line (the document is in a file called test2.tex), the following error message is reported.

For whatever reason, I could not compile the expression in the
provided conditional. This part is quite tricky, since it
involves aspects of the underlying expression language. I will do
my best to help you in any way I can. There are more details
available on this exception:

DETAILS ---------------------------------------------------------

Note that next to the writeToFile signature in the user guide, there's an R indicator. Compare this to the CR indicators next to the exists signature. C indicates that the method can be used in directives, whereas R indicates the method can be used in rules (see the introduction to chapter 6, p. 58). Since there is no C next to writeToFile, this method can't be used in directives.