forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Fortran procedure to move a file.

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
eric_carwardine



Joined: 13 Jun 2009
Posts: 70
Location: Perth, Western Australia

PostPosted: Mon May 17, 2021 10:19 pm    Post subject: Fortran procedure to move a file. Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
DanRRight



Joined: 10 Mar 2008
Posts: 2412
Location: South Pole, Antarctica

PostPosted: Tue May 18, 2021 6:00 am    Post subject: Reply with quote

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
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7070
Location: Salford, UK

PostPosted: Tue May 18, 2021 7:09 am    Post subject: Reply with quote

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
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2240
Location: Yateley, Hants, UK

PostPosted: Tue May 18, 2021 8:55 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group