Silverfrost Forums

Welcome to our forums

Fortran procedure to move a file.

17 May 2021 9:19 #27789

Hallo;

Is there a Fortran procedure to move a file from one location to another?

The locations will be on different devices, such as C: and H:

Eric[/i]

18 May 2021 5:00 #27791

Eric, Suppose you have file a.for and disk H. Then try this

integer*2
character*64 text

text = 'ren a.for H:\a.for'
call cissue@(text,ierr)
if(ierr.gt.0) print*, 'Error=', ierr
end
18 May 2021 6:09 #27792

There is also an FTN95 library routine...

SUBROUTINE RENAME@(FILE1, FILE2, ERROR_CODE) 
CHARACTER (LEN=*) FILE1, FILE2 
INTEGER (KIND=2) ERROR_CODE
18 May 2021 7:55 #27794

Paul,

Does that work across drives?

Eddie

Edit: (As I was too busy earlier this morning to try it. The answer is 'Yes, it does'. Hence it is a MOVE as well as a RENAME).

Please login to reply.