Hi @mg_bg.
Unfortunately, according to the API Files Syntax doc:
The returnType is optional, and if specified, can be any type that’s not an array, string, or handler.
However, you can specify it as a function parameter with an OUT
direction in the .api
file, like so:
FUNCTION read(string dest [READ_SIZE] OUT);
Note that there’s a hard limit of 1100 bytes in an API message payload. This limitation is bidirectional, so both client and server messages are affected. See IPC Limitation - #2 by kmurphy.
Since you’re already working with files, perhaps you’d be better suited using File Descriptors instead? This also gets around the 1100 byte message size limit. I’ve used it extensively in the past.
FUNCTION write(file fd_in IN);
FUNCTION read(file fd_out OUT);
Cheers,
Raf