home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!cs.utexas.edu!hermes.chpc.utexas.edu!aswx266
- From: aswx266@chpc.utexas.edu (Michael Lemke)
- Subject: Re: copying files in FORTRAN on using Sun Fortran
- Message-ID: <1992Aug29.062208.26841@chpc.utexas.edu>
- Organization: The University of Texas System - CHPC
- References: <1992Aug28.195415.27820@ctr.columbia.edu>
- Date: Sat, 29 Aug 92 06:22:08 GMT
- Lines: 24
-
- In article <1992Aug28.195415.27820@ctr.columbia.edu> anselmo@cumesb.mech.columbia.edu (Andrew P. Anselmo) writes:
- >
- >Sorry to intrude on the scientists can/cannot program issue, but a small
- >technical problem...
- >
- >How easy is it to submit unix commands while in a Fortran program?
- >
- >I basically need to copy a file (without knowing the format or what's
- >inside) to another; I've RTFM, but I can't seem to track it down.
-
- Although I don't know where you can find it (presumably man 3F intro
- should get you started) it is easy as pie:
-
- call system( 'cp file1 file2' )
-
- If you want to feed the command's output back to a Fortran variable
- (something similar as set a=`date`) it gets tricky. You would need
- popen for this but I don't know if that is equally easy to access as
- system. See the man page as I mentioned above.
-
- --
- Michael Lemke
- Astronomy, UT Austin, Texas
- (michael@io.as.utexas.edu or UTSPAN::UTADNX::IO::MICHAEL [SPAN])
-