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 

Preconnected logical unit numbers

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



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

PostPosted: Sun Jan 28, 2018 4:18 pm    Post subject: Preconnected logical unit numbers Reply with quote

In new programs, I have steered clear of single digit unit numbers knowing that there were assumptions about preconnection. I recently exhumed something decades old, that used luns of 5 and 6 for input and output respectively, and 2,3,4 for scratch files. Interestingly, while it worked, I couldn't insert a WRITE to the screen as 'unit neither Opened nor preconnected' until I made them 20 to 60 inclusive FTN95 even prohibited writing to * when there was a CLOSE statement left in the program inadvertently.

It occurred to me that I could not find a description of what unit numbers were preconnected.

When this was hard-coded in the OS, I remembered vaguely 5 and 6 being card reader and line printer, but my PC has neither. One nice computer I used has 2 and 7 for this, with 3 and 4 being tape readers, 5 for a tape punch and 9 for the plotter: 1 was the operator's console teletype and 8 a device we didn't have.
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 792

PostPosted: Sun Jan 28, 2018 5:23 pm    Post subject: Reply with quote

FTN95 does not do implicit OPEN to files named FORTnn or something like that, as other compilers do.

Regarding your question: the FTN95 manual says "UNIT values should be greater than 6 to avoid the possibility of re-assigning standard input/output streams." Running the following program reveals that units 1, 2, 5 and 6 are pre-connected with READWRITE access
Code:
program preconn
implicit none
integer :: i,lun
logical :: exists,isopen
character(10) :: act
do i=0,20
   inquire(unit=i,exist=exists,opened=isopen,action=act)
   write(*,'(I3,2x,2L2,2x,A)')i,exists,isopen,act
end do
end program
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Sun Jan 28, 2018 5:35 pm    Post subject: Reply with quote

Hi Mecej4,

Interesting that 0 isn't preconnected. How do you do the test with * ?

Provided you use 1 .. 6 and specifically OPEN them, FTN95 works just fine ...

I never expected to read from a tape or card punch or lineprinter, nor to write to a card or tape reader, and it irritated me that they were different from computer to computer, especially when they had to be hard coded as actual numbers and not as a variable!

Eddie
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 421
Location: Morrison, CO, USA

PostPosted: Sun Jan 28, 2018 6:02 pm    Post subject: Reply with quote

Except for the console (I use Unit=1), I used unit numbers 10-*.

UNITS 1, 2, 5, AND 6 all appear to be attached to the console. All these units are opened for both READ and WRITE.
Back to top
View user's profile Send private message Visit poster's website
John-Silver



Joined: 30 Jul 2013
Posts: 686

PostPosted: Sun Jan 28, 2018 11:53 pm    Post subject: Reply with quote

5 aqnd 6 were always the defaults for input and output respectivley ,to the console , when I startd using fortran (late 70's). Isn't that in the standard ?
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Mon Jan 29, 2018 12:13 am    Post subject: Reply with quote

John,

Standard in the sense that many computers followed it, but not even IBM always followed it, for example the IBM 1130 manual of 1973 states:

1 Console Printer
2 1442 Card Read Punch, Model 6 or 7
3 1132 Printer
4 1134 Paper Tape Reader/1055 Paper Tape Punch
5 1403 Printer
6 Keyboard
7 1627 Plotter
8 2501 Card Reader
9 1442 Card Punch, Model 5
10 Unformatted I/O area on disk

and on the IBM 1800 (same document) the unit numbers were assigned during system installation! 5 is definitely a line printer.

Besides, FTN95 has inter alia both 5 and 6 READWRITE, which definitely wasn't the case when 5 was READ and 6 was WRITE. The idea of having the same device READWRITE when writing involved punching holes in media is rather frightening!

Eddie
Back to top
View user's profile Send private message
LitusSaxonicum



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

PostPosted: Tue Feb 06, 2018 6:46 pm    Post subject: Reply with quote

So despite all the frivolity and reflections on computers and compilers of the past (sorry), the point remains that in FTN95 you can connect the numbered console-preconnected logical unit numbers, but they are ganged, so connecting one or more of them to a file disconnects all the units that would otherwise be preconnected, including *.

Now where is that in the documentation?
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