.TITLE FSY_OPNFIL ; @(#)fsyalphe.mar 17.1.1.1 (ESO-IPG) 01/25/02 17:36:20 ;++ ; OPNFIL - Open Binary File ; ; This routine is used to open an EXISTING Data File for ; subsequent processing. The filename, logical or physical, is ; supplied by the calling program and the file is opened by RMS ; using the User File Open option. This restricts the access to ; the file (on the assigned channel) to the QIO and file-mapping ; system services; no RMS routines can be used. However, the ; file can still be accessed on another channel for RMS process- ; -ing, (see FSY_EXTBDF), as it is opened for file sharing. ; ; The file will be opened for read/only access if the protection ; does not allow read/write operations to be performed. ; ; If the data file is opened successfully, the I/O channel ; number is returned to the calling program. ; ; CALL FSY_OPNFIL(NAME,LEN,IOCHAN,STATUS) ; ; Input argument: ; --------------- ; NAME: char expr Name of Bulk Data File. ; LEN: I*4 Lenght of name ; ; Output arguments: ; ----------------- ; IOCHAN: I*4 I/O channel assigned to file. ; STATUS: I*4 Status return. ; ; ; K. Banse version 1.00 860616 ; K. Banse version 1.10 910918 ; K. Banse version 1.10 930115, for Alpha Open VMS ;-- .PSECT FSYVMSE_1,WRT,NOEXE $RMSDEF BDFFAB: $FAB FOP=, - SHR=, - FAC=, - NAM=BDFNAM BDFFABR: $FAB FOP=, - SHR=, - FAC=, - NAM=BDFNAM BDFNAM: $NAM .PSECT FSYVMSE_2,EXE FSY_OPNFIL:: .CALL_ENTRY ; .WORD ^M<> MOVL 04(AP),BDFFAB+FAB$L_FNA ;addr of NAME string MOVB 08(AP),BDFFAB+FAB$B_FNS ;size of NAME string $OPEN FAB=BDFFAB ;attempt to open file BLBC R0,50$ ;try to open read-only... MOVL BDFFAB+FAB$L_STV,@12(AP) ;return IOCHAN MOVL BDFFAB+FAB$L_STS,@16(AP) ;return STATUS RET 50$: MOVL 04(AP),BDFFABR+FAB$L_FNA ;addr of NAME string MOVB 08(AP),BDFFABR+FAB$B_FNS ;size of NAME string $OPEN FAB=BDFFABR ;attempt to open file BLBC R0,60$ ;abort if open failed MOVL BDFFABR+FAB$L_STV,@12(AP) ;return IOCHAN 60$: MOVL BDFFABR+FAB$L_STS,@16(AP) ;return STATUS RET .END