print from index with buf and readfilesync