View previous topic :: View next topic |
Author |
Message |
eric_carwardine
Joined: 13 Jun 2009 Posts: 70 Location: Perth, Western Australia
|
Posted: Mon May 17, 2021 10:19 pm Post subject: Fortran procedure to move a file. |
|
|
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] |
|
Back to top |
|
|
DanRRight
Joined: 10 Mar 2008 Posts: 2830 Location: South Pole, Antarctica
|
Posted: Tue May 18, 2021 6:00 am Post subject: |
|
|
Eric, Suppose you have file a.for and disk H. Then try this
Code: | integer*2
character*64 text
text = 'ren a.for H:\a.for'
call cissue@(text,ierr)
if(ierr.gt.0) print*, 'Error=', ierr
end
|
|
|
Back to top |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7935 Location: Salford, UK
|
Posted: Tue May 18, 2021 7:09 am Post subject: |
|
|
There is also an FTN95 library routine...
Code: | SUBROUTINE RENAME@(FILE1, FILE2, ERROR_CODE)
CHARACTER (LEN=*) FILE1, FILE2
INTEGER (KIND=2) ERROR_CODE
|
|
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2390 Location: Yateley, Hants, UK
|
Posted: Tue May 18, 2021 8:55 am Post subject: |
|
|
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). |
|
Back to top |
|
|
|