Remove unnecessary usage of os.File

Adding buffer to save snapshot for clean code @xla  @juliusv