
C/C++ cross-platform compatibility
: I'm working on an application I want to compile on many
: different platforms. Somewhere along the line, I need to
: obtain a list of all files in a directory. In OS/2, DOS,
: WinNT, etc... the way to do this is with DosFindFirst and
: DosFindNext. However, these are not part of the ANSI
: standard, so I want to know, what should I use? Are these
: actually supported on everything, or is there another way
: to do this?
: --------------------------
--
Routines related to files and directories (iostreams or the C
stream functions excluded) are not usually portable across platforms. If
it were me, I'd use the POSIX extensions for directory functions where
available. I'd use #ifdefs to add code for platforms that aren't POSIX
compliant.
Laura Michaels
http://members.aol.com/lauram3017/index.html