write/2 definitely doesn’t care whether the thing to write has semicolons or not. Possibly the param hook declares the text parameter such that it cannot be read properly?
What is the error? Normal debugging is to use ?- tspy(create_file). and re-run the request. That should popup the debugger.
There is only one error ERR_EMPTY_RESPONSE, because I don’t response anything. Debugger shows nothing. Perhaps I am wrongly sending the ajax request? I’m using CodeMirror as an editor.
This way you get an illegal www-form-encoded content. You either need to encode and package this correctly or simply use data: myCodeMirror.getValue(). That needs some adjustment to the Prolog side as well, where hyou now need:
The streams are managed outside the handlers. You do need to reply some content though. You can do so using reply_json_dict/1,2, reply_html_page/2,3 or as simple as