cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Fast API for File read/Write
Fast API for File read/Write
Feb 17, 2012 at 3:55am UTC
madhusushmi
(1)
I am looking for fastest API to read/write files. Can you please help?
Feb 17, 2012 at 3:58am UTC
webJose
(2948)
For Windows there's only one: CreateFile(), ReadFile(), WriteFile(). For other OS' I have no idea.
Feb 17, 2012 at 4:25am UTC
JLBorges
(13770)
If the file does not grow or shrink in size, memory mapping the file would give the fastest reads/writes.
http://www.freebsd.org/cgi/man.cgi?query=mmap&apropos=0&sektion=0&manpath=FreeBSD+9.0-RELEASE&arch=default&format=html
Windows: MapViewOfFile
If not, buffered asynchronous i/o (with a pool of buffers) would be worth considering.
http://www.freebsd.org/cgi/man.cgi?query=aio_write&apropos=0&sektion=0&manpath=FreeBSD+9.0-RELEASE&arch=default&format=html
Windows: WriteFileEx (on a file opened with FILE_FLAG_OVERLAPPED)
Topic archived. No new replies allowed.