| 1 |
.TITLE FSY_OPNFIL |
| 2 |
; @(#)fsyalphe.mar 19.1 (ESO-IPG) 02/25/03 13:57:16 |
| 3 |
;++ |
| 4 |
; OPNFIL - Open Binary File |
| 5 |
; |
| 6 |
; This routine is used to open an EXISTING Data File for |
| 7 |
; subsequent processing. The filename, logical or physical, is |
| 8 |
; supplied by the calling program and the file is opened by RMS |
| 9 |
; using the User File Open option. This restricts the access to |
| 10 |
; the file (on the assigned channel) to the QIO and file-mapping |
| 11 |
; system services; no RMS routines can be used. However, the |
| 12 |
; file can still be accessed on another channel for RMS process- |
| 13 |
; -ing, (see FSY_EXTBDF), as it is opened for file sharing. |
| 14 |
; |
| 15 |
; The file will be opened for read/only access if the protection |
| 16 |
; does not allow read/write operations to be performed. |
| 17 |
; |
| 18 |
; If the data file is opened successfully, the I/O channel |
| 19 |
; number is returned to the calling program. |
| 20 |
; |
| 21 |
; CALL FSY_OPNFIL(NAME,LEN,IOCHAN,STATUS) |
| 22 |
; |
| 23 |
; Input argument: |
| 24 |
; --------------- |
| 25 |
; NAME: char expr Name of Bulk Data File. |
| 26 |
; LEN: I*4 Lenght of name |
| 27 |
; |
| 28 |
; Output arguments: |
| 29 |
; ----------------- |
| 30 |
; IOCHAN: I*4 I/O channel assigned to file. |
| 31 |
; STATUS: I*4 Status return. |
| 32 |
; |
| 33 |
; |
| 34 |
; K. Banse version 1.00 860616 |
| 35 |
; K. Banse version 1.10 910918 |
| 36 |
; K. Banse version 1.10 930115, for Alpha Open VMS |
| 37 |
;-- |
| 38 |
|
| 39 |
.PSECT FSYVMSE_1,WRT,NOEXE |
| 40 |
|
| 41 |
$RMSDEF |
| 42 |
|
| 43 |
BDFFAB: $FAB FOP=<UFO>, - |
| 44 |
SHR=<UPI,GET,PUT>, - |
| 45 |
FAC=<GET,PUT>, - |
| 46 |
NAM=BDFNAM |
| 47 |
|
| 48 |
BDFFABR: $FAB FOP=<UFO>, - |
| 49 |
SHR=<UPI,GET>, - |
| 50 |
FAC=<GET>, - |
| 51 |
NAM=BDFNAM |
| 52 |
|
| 53 |
BDFNAM: $NAM |
| 54 |
|
| 55 |
.PSECT FSYVMSE_2,EXE |
| 56 |
|
| 57 |
FSY_OPNFIL:: .CALL_ENTRY |
| 58 |
|
| 59 |
; .WORD ^M<> |
| 60 |
MOVL 04(AP),BDFFAB+FAB$L_FNA ;addr of NAME string |
| 61 |
MOVB 08(AP),BDFFAB+FAB$B_FNS ;size of NAME string |
| 62 |
|
| 63 |
$OPEN FAB=BDFFAB ;attempt to open file |
| 64 |
BLBC R0,50$ ;try to open read-only... |
| 65 |
|
| 66 |
MOVL BDFFAB+FAB$L_STV,@12(AP) ;return IOCHAN |
| 67 |
MOVL BDFFAB+FAB$L_STS,@16(AP) ;return STATUS |
| 68 |
RET |
| 69 |
|
| 70 |
|
| 71 |
50$: MOVL 04(AP),BDFFABR+FAB$L_FNA ;addr of NAME string |
| 72 |
MOVB 08(AP),BDFFABR+FAB$B_FNS ;size of NAME string |
| 73 |
|
| 74 |
$OPEN FAB=BDFFABR ;attempt to open file |
| 75 |
BLBC R0,60$ ;abort if open failed |
| 76 |
|
| 77 |
MOVL BDFFABR+FAB$L_STV,@12(AP) ;return IOCHAN |
| 78 |
|
| 79 |
60$: MOVL BDFFABR+FAB$L_STS,@16(AP) ;return STATUS |
| 80 |
RET |
| 81 |
|
| 82 |
.END |