Re: Read DOS or Unix files with the same fortran code



feenberg@xxxxxxxxx wrote:
I would like my fortran program to be able to read text files with
either Unix or DOS line endings..

The read is free format. (read(*,*) (x(i),i=1,22).
The compiler is gcc version 3.4.6 [FreeBSD] 20060305
The OS is FreeBSD 6.2
Code is standard F77

Is there an option I could set or another compiler that I could use
that would allow the stray contol-Ms in DOS formatted files without
getting upset? I understand that I could preprocess DOS files with
dos2unix, but that adds complications I would prefer to avoid.

If you are adding these characters on a Windows system, use ftp ascii
mode when moving them to FreeBSD. Or, set the editor option on Windows
which doesn't add \r characters. Most compilers on Windows will accept
the files without the \r.
.



Relevant Pages

  • Re: Read DOS or Unix files with the same fortran code
    ... either Unix or DOS line endings.. ... The read is free format. ... The compiler is gcc version 3.4.6 [FreeBSD] 20060305 ... Is there an option I could set or another compiler that I could use ...
    (comp.lang.fortran)
  • Re: Read DOS or Unix files with the same fortran code
    ... either Unix or DOS line endings.. ... The read is free format. ... The compiler is gcc version 3.4.6 [FreeBSD] 20060305 ... Is there an option I could set or another compiler that I could use ...
    (comp.lang.fortran)
  • Re: Read DOS or Unix files with the same fortran code
    ... either Unix or DOS line endings.. ... The read is free format. ... The compiler is gcc version 3.4.6 [FreeBSD] 20060305 ... Is there an option I could set or another compiler that I could use ...
    (comp.lang.fortran)
  • Re: Read DOS or Unix files with the same fortran code
    ... either Unix or DOS line endings.. ... The read is free format. ... The compiler is gcc version 3.4.6 [FreeBSD] 20060305 ... Is there an option I could set or another compiler that I could use ...
    (comp.lang.fortran)
  • Re: Read DOS or Unix files with the same fortran code
    ... either Unix or DOS line endings.. ... The compiler is gcc version 3.4.6 [FreeBSD] 20060305 ... Is there an option I could set or another compiler that I could use ... Write the adjusted line to the scratch file. ...
    (comp.lang.fortran)