| 41 | } |
| 42 | |
| 43 | FileWriter::FileWriter(const char* file_name) : _size(0) { |
| 44 | _fd = open(file_name, O_WRONLY | O_TRUNC | O_CREAT, 0644); |
| 45 | _buf = (char*)malloc(BUF_SIZE); |
| 46 | } |
| 47 | |
| 48 | FileWriter::FileWriter(int fd) : _fd(fd), _size(0) { |
| 49 | _buf = (char*)malloc(BUF_SIZE); |