POST your favorite FILE i/o methods
What are your favorite (considerations: speed, ease of use)
libraries / functions for: (C or C++, indicate platform)
datafile i/o? textfile i/o?
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.
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.
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.
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.
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.
Na, I wrote my own I/O streams, and use them religiously.
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.
For the basics, I'm quite fond of Visual Basic .NET 2005's My.Computer.* stuff for filesytem.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement