MCPcopy Create free account
hub / github.com/acl-dev/acl / open

Method open

lib_acl_cpp/src/stream/aio_fstream.cpp:47–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47bool aio_fstream::open(const char* path, unsigned int oflags, unsigned int mode)
48{
49 ACL_VSTREAM* fp = acl_vstream_fopen(path, oflags, mode, 8192);
50 if (fp == NULL) {
51 return false;
52 }
53 stream_ = acl_aio_open(handle_->get_handle(), fp);
54
55 // ���û���� enable_error ���� handle �������첽������,
56 // ͬʱע��رռ���ʱ�ص�����
57 this->enable_error();
58
59 // ֻ�е������ӳɹ���ſ� hook IO ��д״̬
60 // hook ���ص�����
61 if ((oflags & (O_RDONLY | O_RDWR | O_APPEND | O_CREAT | O_TRUNC))) {
62 this->enable_read();
63 }
64
65 // hook д�ص�����
66 if ((oflags & (O_WRONLY | O_RDWR | O_APPEND | O_CREAT | O_TRUNC))) {
67 this->enable_write();
68 }
69
70 return true;
71}
72
73bool aio_fstream::open_trunc(const char* path, unsigned int mode /* = 0600 */)
74{

Callers

nothing calls this directly

Calls 6

acl_vstream_fopenFunction · 0.85
acl_aio_openFunction · 0.85
enable_errorMethod · 0.80
enable_readMethod · 0.80
enable_writeMethod · 0.80
get_handleMethod · 0.45

Tested by

no test coverage detected