Mail Archives: cygwin/2005/01/05/16:16:49
------=_NextPart_000_06DC_01C4F374.2DF65210
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
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 DOT krahenbuhl AT m-td DOT 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 AT m-td DOT com
Web page: www.m-td.com
---------------------------------------------------
------=_NextPart_000_06DC_01C4F374.2DF65210
Content-Type: application/octet-stream;
name="toto.dat"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="toto.dat"
1
2
3=20
4
6
------=_NextPart_000_06DC_01C4F374.2DF65210
Content-Type: application/octet-stream;
name="toto.f"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="toto.f"
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 program toto
------=_NextPart_000_06DC_01C4F374.2DF65210
Content-Type: text/plain; charset=us-ascii
--
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/
------=_NextPart_000_06DC_01C4F374.2DF65210--
- Raw text -