Balan Sinniah wrote:
> I am writing a simple socket pogramming where I am using 2 different
> operating system, Linux and Windows95. I am sending a file from Windows95
> to linux and vice versa. The program written in C for linux using
> fread() function to read line by line from a given file and the program
> receive a different file from windows95 (Visual Basic) and store it in a
> buffer before write it in a file. When I try to write the buffer in a
> file, it is not written as it should be ..I mean it is not written
> line by line but everything in one line..These happen in windows95
> too.. Please guide me...
I think that you'll need to provide more details.
If you want to read/write data a line at a time, then you will
probably want to use fgets/fputs, unless the data contains NUL
characters.
Also, if the file is a text file, you need to decide whether you're
going to translate between Unix (LF) and DOS/Windows (CR LF)
end-of-line conventions. If you try to read a Unix text file on a
DOS/Windows system without converting it, you may run into problems
(WordPad/Write will handle it OK, NotePad won't).
--
Glynn Clements <[EMAIL PROTECTED]>