In article <. com>,
<> wrote:
> I need to write a program that should work on both windows and linux
>systems. I have to do lot of file handling (file creation, checking
>access permissions etc) and have to use lots of system specific APIs
>(like popen etc) in my code. I don't want to put #ifdef windows and
>#ifdef linux, for all system specific calls. This makes code quite
>unreadable. Is there a good way of doing it ?
Isolate the system-specific portions so that your main code calls
(e.g.,) "check_access_rights", and have that -one- routine
know about the system differences.
This does presume that you can find unified "intentions" at
each point and represent them in a system-independant manner in
the API you create.
--
"No one has the right to destroy another person's belief by
demanding empirical evidence." -- Ann Landers