| 22 | } |
| 23 | |
| 24 | void fstream::open(ACL_FILE_HANDLE fh, unsigned int oflags, |
| 25 | const char* path /* = NULL */) |
| 26 | { |
| 27 | open_stream(true); // ���û�����ȴ����������� |
| 28 | |
| 29 | acl_assert(ACL_VSTREAM_FILE(stream_) == ACL_FILE_INVALID); |
| 30 | |
| 31 | stream_->fread_fn = acl_file_read; |
| 32 | stream_->fwrite_fn = acl_file_write; |
| 33 | stream_->fwritev_fn = acl_file_writev; |
| 34 | stream_->fclose_fn = acl_file_close; |
| 35 | |
| 36 | stream_->fd.h_file = fh; |
| 37 | stream_->type = ACL_VSTREAM_TYPE_FILE; |
| 38 | stream_->oflags = oflags; |
| 39 | stream_->omode = 0600; |
| 40 | |
| 41 | opened_ = true; |
| 42 | eof_ = false; |
| 43 | |
| 44 | if (path && *path) { |
| 45 | acl_vstream_set_path(stream_, path); |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | bool fstream::open(const char* path, unsigned int oflags, int mode) |
| 50 | { |
no test coverage detected