This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Default buffer size of class basic_filebuf
- From: "Weber, Peter (Wilken GmbH)" <peter dot weber at wilken dot de>
- To: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Date: Fri, 27 Apr 2012 11:45:54 +0000
- Subject: Default buffer size of class basic_filebuf
Hello!
I want to figure out the default buffer-size of the class basic_filebuf.
I know the member function pubsetbuf() and it seems to have a great
impact on the performance during file copy.
Question: Where I can find the default buffer size for basic_filebuf?
The standard for C++ doesn't define a member function pubgetbuf() or
something like this, also the member function is_avail() doesn't help
either. I can't find any constant. I know BUFSIZ from <cstdio> and it
defaults on my machine to 8192 Bytes, which performs well for me with
fread()/fwrite() and read()/write().
I doing some testing on simple file copying:
http://stackoverflow.com/questions/10195343/copy-a-file-in-an-sane-safe-and-efficient-way
Thanks
Peter Weber