POST your favorite FILE i/o methods

Started by
5 comments, last by TheUnbeliever 18 years, 8 months ago
What are your favorite (considerations: speed, ease of use) libraries / functions for: (C or C++, indicate platform) datafile i/o? textfile i/o?
Advertisement
Ehm...fstream in C++, and most other languages are pretty orthogonal with file IO.

As far as file formats, I personally tend to drift towards binary formats for anything that can't easily be written by hand (for example a mesh file). For things that are easily written or modified by hand, XML is usually my favorite. I don't particularly like normal text files, mainly because I hate writing parsers.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
perl's file IO is fairly fantastic as far as ease of use goes.
It depends a little on if which kind of files I'm working on and the project's portability requirements, but memory mapped files are very comfortable to work with when used fully.

I also have a weird fascination with writing parsers manually, and parsing techniques in general..
There's quite a few dedicated parser languages on various scopes. So I recommend learning about regexps, lex and yacc if you intend to work with text files.
BufferedReader and BufferedWriter I guess.
Real men use the Win32 (or equivalent) API straight, none of this fancy-schmancy 'standard' stuff [grin]

Na, I wrote my own I/O streams, and use them religiously.
Free speech for the living, dead men tell no tales,Your laughing finger will never point again...Omerta!Sing for me now!
Hmm, I/O on my operating system is somewhat limited due to the as-yet lack of a driver for any filesystem.

For the basics, I'm quite fond of Visual Basic .NET 2005's My.Computer.* stuff for filesytem.
[TheUnbeliever]

This topic is closed to new replies.

Advertisement