string representing file path.
a fuction called when operation finished or an error occurred.
1 import std.file : write, remove; 2 import dpromise.utils : runEventloop; 3 4 write("hoge.txt", "hogehogepiyopiyo"); 5 scope(exit) remove("hoge.txt"); 6 7 readTextAsyncWithCallback!string("hoge.txt", (s, e) nothrow { 8 assert(e is null); 9 assert(s == "hogehogepiyopiyo"); 10 }); 11 12 runEventloop();
Read file path with asynchronous IO then calls the callback function with data as string(validate with std.utf.validate).
If an error occurred, the callback function will be called with the error.