cygwin vs linux: output differences

Yves Krähenbühl - MTD yves.krahenbuhl@m-td.com
Wed Jan 5 21:17:00 GMT 2005


Same programme compiled under Cygwin writes output which differs form its
LINUX-compiled version


I apologise in advance if the question is too trivial but I am a simple user
and not a programmer.
I have written a small FORTRAN programme which reads and writes numbers in a
file:

program toto
implicit none
integer ifi1,a,b,c
ifi1=10
b=6
open(ifi1,file='toto.dat',status='unknown')
read(ifi1,100)a
print*,a
write(ifi1,100)b
read(ifi1,100)c
print*,c
close(ifi1)
100 format(i3)
end

Starting form the file toto.dat:
1
2
3
4
5
6

Under LINUX the programme re-writes the number 6 on the second line, and the
resulting toto.dat file is:
1
6

whereas under CYGWIN (cygwin-1.5.4-1 from 17.09.2003) the number 6 is
written after lhe last line and one gets the following toto.dat:
1
2
3
4
5
6
6

Can someone tell me how to avoid that problem under CYGWIN ?

Thank you in advance

Yves
----------------------------------------------------
Yves Krahenbuhl, Ph.D.
Director
Tel: +41 79 443 34 73 (cellular)
Email: yves.krahenbuhl@m-td.com
---------------------------------------------------
M-TD Modelling and Technology Development
Ecole Polytechnique Fédérale de Lausanne
PSE-C
CH-1015 Lausanne
Switzerland
Tel: +41 21 693 83 98
Fax: +41 21 646 41 33
Email: info@m-td.com
Web page: www.m-td.com
---------------------------------------------------



-------------- next part --------------
A non-text attachment was scrubbed...
Name: toto.dat
Type: application/octet-stream
Size: 21 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20050105/e5829814/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: toto.f
Type: application/octet-stream
Size: 340 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20050105/e5829814/attachment-0001.obj>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list