home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!elroy.jpl.nasa.gov!nntp-server.caltech.edu!draco.macsch.com!drd
- From: drd@macsch.com (Daniel R. Dawson)
- Subject: Re: programming style question
- Message-ID: <1992Aug21.184751.9673@draco.macsch.com>
- Sender: usenet@draco.macsch.com (Usenet Poster)
- Organization: The MacNeal-Schwendler Corporation
- References: <1992Aug13.004056.3819@ccu1.aukuni.ac.nz> <1992Aug13.081049.4648@newssrv.edvz.univie.ac.at> <1992Aug14.002538.3929@monu6.cc.monash.edu.au>
- Date: Fri, 21 Aug 92 18:47:51 GMT
- Lines: 55
-
- >pm@katz.cc.univie.ac.at (Peter Marksteiner) writes:
- >>ecmtwhk@ccu1.aukuni.ac.nz (Thomas Koenig) writes:
- >>
- >>>It's a real shame that Unix does not have standard way of attatching
- >>>FORTRAN units to file descriptors, that would make things much easier.
- >>>Does POSIX have anything to say about that?
- >>
- >>Try symbolic links. For example,
- >>
- >> ln -s /whatever/pathname/you/want fort.3
- >>
- >>may not be as beautiful as
- >>
- >>//FT03F001 DD DSN=REVOLTING.MVS.DATASET,DISP=NEW
- >>
- >>but it works almost as well.
- >
- >Unfortunately `almost' is important here. One of the nice features of
- >VMS (gargle) was the ability to use:
- >
- >$ define/user_mode 'P1'.dat for005
- >$ define/user_mode 'P1'.out for006
- >$ run myprog
- >
- >in a command procedure. The advantage here is that you can have that
- >program running on at least two different sets of data in the same directory
- >at the same time. The only way you can do this with symbolic links is to
- >place the data files in different directories. A royal pain if you are
- >doing a lot of batch processing, which I suspect applies to most serious
- >FORTRAN users. A very bad design decision from a supposedly flexible
- >operating system.
- >
- >I, and probably many others, get around the problem by passing the
- >argument (P1, above) into the program using getarg, doing some string
- >handling to create the file names and using open explicitly. Messy.
- >
-
- Forget about using links, man!
-
- Here's how I'd handle this problem for Unix boxes:
-
- (C-Shell script fragment similar to the DCL script fragment above)
- setenv FOR005 ${1}.dat
- setenv FOR006 ${1}.out
- myprog
- unsetenv FOR005
- unsetenv FOR006
-
- Then, in the Fortran, just use getenv() to get the filenames
- for the open statements.
-
- Easy as pie!
-
- Dan Dawson
- The MacNeal-Schwendler Corporation
-