print from index with buf and readfilesync 2