moved file checking to sep func
test compare stat (os) filesize to buffer calculated size