Balan Sinniah wrote:

> My file is a textfile and contains around 300 lines . It is in a linux 
> machine and I am reading the file using fread() rather than using fgets 
> because when I use fgets() , the new line character is added.

Both fgets() and fread() will read the LF character into the buffer. 
The difference is that with fgets(), the LF will always be the last
character read.

> So when I try to open it in Windows95 I am getting rubbish.

Are you sending the LF across the network to the Win95 box? If not,
it can't tell where lines end.

> Can u guide me to convert the linux text file before I read it in
> Windows95.

If you open the output file at the Windows end in text mode (i.e. 
don't include `b' in the second argument to fopen()), LF should be
converted to CR LF automatically.

-- 
Glynn Clements <[EMAIL PROTECTED]>

Reply via email to