I m trying to write some content in file using append mode in erlang but it giving error as bad argument.
Syntax used: file:write_file("/tmp/test1.txt","Abhimanyu","append").
error:{error,badarg}
thank you
The file:write_file
function expects the last argument to be a list of atoms iso a string so changing your implementation to file:write_file("/tmp/test1.txt","Abhimanyu", [append]).
should resolve your issue. Further examples can be found at TrapExit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With