buf to buffer
filename added