Implement buffering in the FS library