Re: reading two separate files
- From: sara_patty <k_partha@xxxxxxxxx>
- Date: Mon, 10 Dec 2007 19:26:49 -0800 (PST)
On Dec 8, 2:25 pm, Gary Scott <garylsc...@xxxxxxxxxxxxx> wrote:
sara_patty wrote:
On Dec 7, 6:55 pm, glen herrmannsfeldt <g...@xxxxxxxxxxxxxxxx> wrote:
Richard Maine wrote:
sara_patty <k_par...@xxxxxxxxx> wrote:
Why do we still need UNITs anyway?? remnants from the old Tape decks
physically mounted on and off. Why dont they just define files with
quotes or whatever to be stored in the buffer or hard disks??
Unit numbers being numeric is indeed a throwback to numbered tape
drives. I'd love to see a transition to non-numeric handles. But getting
rid of unit identifiers of some kind or other isn't going to happen.
That's just completely impractical for more reasons than could be
readily summarized.
There are a few different ways to do it. The user assigned UNIT
number of Fortran, where the user is responsible for assigning a
unique number to each file open at the same time. The unix system
where open() returns a small integer indicating the next available
file descriptor. C has (FILE*) variables and PL/I FILE variables
assigned at open and can be passed to other routines. IBM mainframe
systems have DDnames, eight character identifiers where again the user
is responsible for assigning a unique name.
I'm not even entirely sure what you are asking for (and the lack of
clarity is in itself a bit telling), but the closest I can guess is that
you are suggesting that the whole file name be used as the identifier
for every I/O statement. That doesn't seem like an improvement; carry
around an identifier likely to be hundreds of characters long instead of
a simple integer or other small handle? Forget that.
awk does that, which makes some sense for an interpreted language,
and not much sense for a compiled language. There is no OPEN,
awk opens a new file when a name is used that isn't already open.
There is a close(), though.
If it isn't that, my next best guess is that you might be suggesting
that we get rid of the concept of file connections at all. That's not
going to happen either. I don't consider it worth even discussing why;
if other people feel it worthwhile (and if that is really what you are
suggesting), they are free to do so.
As long as I/O is buffered, it isn't likely to happen.
-- glen
Thanks for all the well written and helpful comments, sometimes
pejorative!
It is interesting how well written are IBM and other manuals, one
suspects they are all written by Ph. D's in English from Princeton??
I think it is more like a committee. It gets reviewed and re-reviewed,
and delayed, and delayed, and released only when it's darn near perfect,
but years overdue.
--
Gary Scott
mailto:garylscott@sbcglobal dot net
Fortran Library: http://www.fortranlib.com
Support the Original G95 Project: http://www.g95.org
-OR-
Support the GNU GFortran Project: http://gcc.gnu.org/fortran/index.html
If you want to do the impossible, don't hire an expert because he knows
it can't be done.
-- Henry Ford
Subject: Unit #s and Horses' ass
RAILROADS
Does the statement, "We've always done it like that" ring any bells?
The US standard railroad gauge (distance between the rails) is 4
feet, 8.5 inches.
That's an exceedingly odd number. Why was that gauge used?
Because that's the way they built them in England , and English
expatriates built
the US Railroads.
Why did the English build them like that?
Because the first rail lines were built by the same people who built
the
pre-railroad tramways, and that's the gauge they used.
Why did "they" use that gauge then?
Because the people who built the tramways used the same jigs and
tools
that they used for building wagons, which used that wheel spacing.
Okay! Why did the wagons have that particular odd wheel spacing?
Well, if they tried to use any other spacing, the wagon wheels would
break on some of the old, long distance roads in England , because
that's the spacing of the wheel ruts.
So who built those old rutted roads?
Imperial Rome built the first long distance roads in Europe (and
England ) for their legions. The roads have been used ever since.
And the ruts in the roads?
Roman war chariots formed the initial ruts, which everyone else had
to match for fear of destroying their wagon wheels. Since the
chariots
were made for Imperial Rome, they were all alike in the matter of
wheel spacing.
The United States standard railroad gauge of 4 feet, 8.5 inches is
derived from the original specifications for an Imperial Roman war
chariot. And bureaucracies live forever.
So the next time you are handed a specification and wonder what
horse's ass came up with it, you may
be exactly right, because the Imperial Roman army
chariots were made just wide enough to accommodate the back ends of
two war horses!
Now, the twist to the story
When you see a Space Shuttle sitting on its launch pad, there are two
big booster rockets attached to the sides of the main fuel tank.
These
are solid rocket boosters, or SRBs.
The SRBs are made by Thiokol at their factory at Utah . The engineers
who designed the SRBs would have preferred to make them a bit
fatter,
but the SRBs had to be shipped by train from the factory to the
launch
site.
The railroad line from the factory happens to run through a tunnel in
the mountains.
The SRBs had to fit through that tunnel.
Im sure you would love this one...
The tunnel is slightly wider than the railroad track, and the
railroad
track,
as you now know, is about as wide as two horses' behinds.
So, a major Space Shuttle design feature of what is arguably the
world's most advanced transportation system was determined over two
thousand years ago by the width of a horse's ass.
You thought being a HORSE'S ASS wasn't important!
.
- Follow-Ups:
- Re: reading two separate files
- From: Dan Nagle
- Re: reading two separate files
- References:
- Re: reading two separate files
- From: sara_patty
- Re: reading two separate files
- From: *** Hendrickson
- Re: reading two separate files
- From: sara_patty
- Re: reading two separate files
- From: Richard Maine
- Re: reading two separate files
- From: glen herrmannsfeldt
- Re: reading two separate files
- From: sara_patty
- Re: reading two separate files
- From: Gary Scott
- Re: reading two separate files
- Prev by Date: Re: Best Command Line Parsers
- Next by Date: Re: fseek and unformatted sequential files
- Previous by thread: Re: reading two separate files
- Next by thread: Re: reading two separate files
- Index(es):