use fs and buffer