added unittest and fixed growth feature of darray
added appender params
close the file appended on exit