Issues with the FILE() function

I had a number of unexpected problems when trying to create files using the FILE(function) on Asterisk version 11.10.2.

First, it took me a while to figure out how to write newlines. It’s sort of there in the examples, but the actual description of line mode does not say that it is the way to write new lines,

Second, the line mode won’t append to a file that doesn’t already contain a new line. I’d say that violates the principle of least surprise. If it’s a limitation for a good reason, it should at least be documented. I think it’s a good thing to warn on, but I would prefer it to just warn, not refuse to write anything.

Third is the show stopper for me. It doesn’t seem able to create a file in line mode. If I do

    same => n,SET(FILE(/tmp/report.txt)=FROM=01632660765)

that will create /tmp/report.txt. If on the other hand I do

    same => n,SET(FILE(/tmp/report.txt,,,l)=FROM=01632660765)

it tells me the file doesn’t exist, which I knew anyway, and refuses to write anything.

Am I missing something? I would have thought that not being able to create a line mode file would be an obvious limitation, which would be fixed quickly?