Re: file copy routine



GaryScott wrote:
On May 19, 6:42 am, John <gh14...@xxxxxxxxx> wrote:
David Frank wrote:
Below uses "stream" i/o which is standard with F2003
but in CVF and several other compilers using following syntax:
You are guaranteed an exact copy with identical #bytes in new file as old
file.
! -----------------
program file_copy
character :: ch
open (11,file='text.old',form='binary')
open (22,file='text.new',form='binary')
do
read (11,end=101) ch
write (22) ch
end do
101 stop
end program
That's pretty nice, but until (complete) F2003 compilers become more
commonplace, I think I will stick with F95. Still, I look forward to
getting my hands on a F2003 compiler that implements the full standard.

John- Hide quoted text -

- Show quoted text -

The conversion to F2003 once a compiler is available is trivial. Many
times people waste far more time trying devise a "standard conforming"
solution when a trivial extension such as this will suffice for the
particular problem at hand.


Yes, but where I work, there are various Fortran compilers and the code needs to work on all of them. Of the ones we have, I think only g95 and gfortran have any F2003 extensions at all. We usually only use these for development because the executables are slower than our other compilers.

John
.



Relevant Pages

  • Re: What do you prefer: real(8) or double precision and why?
    ... > As far as I know, it came first in the OS/360 Fortran compilers. ... types had names which were standard conforming. ... no persistent error is to be expected. ... no deficiencies and the other way is to make it so complicated ...
    (comp.lang.fortran)
  • Re: Is this standard-conforming?
    ... compiler option -Mlarge_arrays. ... The only question I see is whether it is standard conforming for a ... Compilers can be standard conforming and still fail to work on some ... I think the OP has a legitimate quality of implementation gripe, ...
    (comp.lang.fortran)
  • Re: surprising behaviour of .EQ.
    ... Standard conforming or not, it is often done in x87 floating point. ... The only way to get the reduced precision (from 64 significant ... Some compilers have an option such as -ffloatstore to reduce ... that a standard conforming floating point implementation can ...
    (comp.lang.fortran)
  • Re: Determining a functions calling address
    ... > the one you have in a standard conforming mode. ... > illegality of taking the address of main, ... > void doThisStuff ... those compilers and I don't know where to get them. ...
    (comp.lang.cpp)
  • Re: file copy routine
    ...    write ch ... but until F2003 compilers become more ... times people waste far more time trying devise a "standard conforming" ... solution when a trivial extension such as this will suffice for the ...
    (comp.lang.fortran)