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

Method open_write

lib_acl_cpp/samples/fs_benchmark/fs_benchmark.cpp:41–62  ·  view source on GitHub ↗

ֻд��ʽ�����ļ�

Source from the content-addressed store, hash-verified

39
40 // ֻд��ʽ�����ļ�
41 bool open_write()
42 {
43 fp_ = new acl::aio_fstream(handle_);
44 filepath_.format("%s/%lu_%d_%d", path_.c_str(),
45 (unsigned long) acl_pthread_self(), ibegin_, ifile_++);
46 if (fp_->open_write(filepath_.c_str()) == false)
47 {
48 printf("open file %s error: %s\r\n",
49 filepath_.c_str(), acl::last_serror());
50 return false;
51 }
52
53 // ����д�ɹ��Ļص�����
54 fp_->add_write_callback(this);
55
56 // ���ӹرյĻص�����
57 fp_->add_close_callback(this);
58
59 // 1 ����������
60 fp_->write(__data, sizeof(__data), delay_ * 1000000);
61 return true;
62 }
63protected:
64 bool read_callback(char*, int)
65 {

Callers 12

on_hdrMethod · 0.45
on_hdrMethod · 0.45
get_urlFunction · 0.45
thread_mainFunction · 0.45
rfc2047_test_fileFunction · 0.45
get_htmlFunction · 0.45
doUploadMethod · 0.45
proc_on_initMethod · 0.45
doUploadMethod · 0.45
test_zlib_pipeFunction · 0.45
test_unzip_fileFunction · 0.45
mime_test1Function · 0.45

Calls 7

acl_pthread_selfFunction · 0.85
add_write_callbackMethod · 0.80
add_close_callbackMethod · 0.80
last_serrorFunction · 0.50
formatMethod · 0.45
c_strMethod · 0.45
writeMethod · 0.45

Tested by 2

test_zlib_pipeFunction · 0.36
test_unzip_fileFunction · 0.36