From: system@SendSpamHere.ORG Sent: Monday, September 20, 1999 3:48 PM To: Info-VAX@Mvb.Saic.Com Subject: Re: Process Permanent Files In article <37E625D2.10B2E37D@rtfmcsi.com>, Chuck Chopp writes: >Arne Vajhøj wrote: > >> JF Mezei wrote: >> > I have been told that when you $OPEN a file from DCL, it is opened as a >> > process permanent file. >> > >> > How can I reproduce this from a program with the $OPEN ? Looked thorugh the >> > fields used by $OPEN but couldn't find anything. >> >> I think the main (whole ?) part of the trick is to open the file >> in a mode more priviliged than user-mode. >> >> If you open the file in supervisor or executive mode, then the >> file should not be closed at image exit. >> >> Arne > >I'm curious about this, too, since I have not done a tremendous amount of >programming at the higher/inner access mode. > >What do we use to keep track of the handle to the open file once our image >reduces its access mode back to user mode and then runs down? The IFaB and/or IRaB of the file you've opened. There is a table maintained in the process's P1 space and pointed to by the cell: PIO$GW_PIOIMPA. I did a simple program to open a file process permanent: .PSECT DATA,WRT,NOEXE,5 FAB: $FAB FNM=SYS$MANAGER:PPF.TXT,FOP= RAB: $RAB FAB=FAB .PSECT CODE,NOWRT,EXE,5 .ENTRY GO,0 $CMEXEC_S ROUTIN=PPFOPEN RET .ENTRY PPFOPEN,0 $OPEN FAB=FAB $CONNECT RAB=RAB RET .END GO This opened the file and its IFI is 8003. Now to look for it in P1 space. SDA> READ SYS$LOADABLE_IMAGES:RMSDEF.STB SDA> FORM/TYP=IMP PIO$GW_PIOIMPA 00000000.7FFD0090 IMP$W_RMSSTATUS 0000 00000000.7FFD0092 IMP$B_PROT 05 00000000.7FFD0093 00 00000000.7FFD0094 IMP$L_IOSEGADDR 7B132400 00000000.7FFD0098 IMP$L_IOSEGLEN 0001FC00 00000000.7FFD009C IMP$L_FREEPGLH 7B128000 00000000.7FFD00A0 7B12D800 00000000.7FFD00A4 IMP$L_SAVED_SP 00000000 00000000.7FFD00A8 IMP$L_IFABTBL 7FFD0C00 <- PPF IFaBs 00000000.7FFD00AC IMP$L_IRABTBL 7FFD0D00 <- PPF IRaBs 00000000.7FFD00B0 IMP$W_ENTPERSEG 003F <- count per seg. 00000000.7FFD00B2 IMP$W_NUM_IFABS 0006 00000000.7FFD00B4 IMP$L_IFBTBLINK 00000000 00000000.7FFD00B8 00050001 00000000.7FFD00BC 7B127C00 00000000.7FFD00C0 00000400 00000000.7FFD00C4 00287600 00000000.7FFD00C8 7B126400 00000000.7FFD00CC 00000000 00000000.7FFD00D0 7FFD00DC PIO$GW_IIOIMPA+00024 00000000.7FFD00D4 7FFD011C PIO$GW_IIOIMPA+00064 00000000.7FFD00D8 0006000F 00000000.7FFD00DC 00000000 00000000.7FFD00E0 7B125208 00000000.7FFD00E4 00284008 00000000.7FFD00E8 00285208 00000000.7FFD00EC 00286408 00000000.7FFD00F0 00000000 00000000.7FFD00F4 IMP$L_IRBTBLINK 00288808 I now examine the table pointed to by IMP$L_IFABTBL... SDA> EXAM 7FFD0C00;4*3f 7B129C08 7B12A208 7B129608 00000000 .......{.¢.{...{ 00000000.7FFD0C00 Zeros suppressed from 00000000.7FFD0C10 through 00000000.7FFD0CFB And, lastly, I format the IFaBs (I've selected the IFaB of the file I've opened. SDA> FORM/TY=IFB 7B129C08 00000000.7B129C08 IFB$L_PRIM_DEV 144D4008 00000000.7B129C0C IFB$L_BKPBITS 04400140 00000000.7B129C10 IFB$B_BID 0B 00000000.7B129C11 IFB$B_BLN 4A 00000000.7B129C12 IFB$B_MODE 01 00000000.7B129C13 IFB$B_EFN 00 00000000.7B129C14 IFB$L_FSBPTR 00000000 00000000.7B129C18 IFB$L_IOS 00000001 IFB$W_IOS2 00000000.7B129C1C IFB$L_IOS4 00000000 00000000.7B129C20 IFB$L_RU_STALL_ASB 00000000 00000000.7B129C24 IFB$L_ASBADDR 7B128000 00000000.7B129C28 IFB$L_WAIT_Q_FLINK 00000000 00000000.7B129C2C IFB$L_WAIT_Q_BLINK 00000000 00000000.7B129C30 IFB$Q_RU_STALL_QL 00000000 00000000.7B129C34 00000000 00000000.7B129C38 IFB$L_IRAB_LNK 7B12D6D0 00000000.7B129C3C IFB$L_LAST_FAB 7FFA5EC0 00000000.7B129C40 IFB$L_ATJNLBUF 00000000 00000000.7B129C44 IFB$L_JNLBDB 00000000 00000000.7B129C48 IFB$B_FILE_LOCK_MODE 00 00000000.7B129C49 IFB$B_ACCESS_MODE 01 00000000.7B129C4A 0000 00000000.7B129C4C IFB$L_RESERVED1 00000000 00000000.7B129C50 IFB$L_RESERVED2 00000000 00000000.7B129C54 IFB$W_IFI 8003 <-- My file! 00000000.7B129C56 IFB$W_ECHO_ISI 0000 00000000.7B129C58 IFB$W_CHNL 00C0 00000000.7B129C5A IFB$B_FAC 02 00000000.7B129C5B IFB$B_ORGCASE 00 00000000.7B129C5C IFB$L_FWA_PTR 7B12CA00 00000000.7B129C60 IFB$L_NWA_PTR 00000000 00000000.7B129C64 IFB$L_BDB_FLNK 7B129E00 00000000.7B129C68 IFB$L_BDB_BLNK 7B129E00 00000000.7B129C6C IFB$L_RLB_FL_FLINK 7B129C6C 00000000.7B129C70 IFB$L_RLB_FL_BLINK 7B129C6C 00000000.7B129C74 IFB$L_DEVBUFSIZ 00000200 00000000.7B129C78 IFB$W_RTDEQ 0000 00000000.7B129C7A IFB$B_SHR 00 00000000.7B129C7B IFB$B_AGENT_MODE 01 00000000.7B129C7C IFB$B_RFMORG 03 00000000.7B129C7D IFB$B_RAT 04 00000000.7B129C7E IFB$W_LRL 0000 00000000.7B129C80 IFB$L_HBK_DISK 00000000 00000000.7B129C84 IFB$L_EBK_DISK 00010000 00000000.7B129C88 IFB$W_FFB 0000 00000000.7B129C8A IFB$B_BKS 00 00000000.7B129C8B IFB$B_FSZ 02 00000000.7B129C8C IFB$W_MRS 0000 00000000.7B129C8E IFB$W_DEQ 0000 00000000.7B129C90 IFB$W_GBC 0000 00000000.7B129C92 0000 00000000.7B129C94 IFB$L_LOCK_BDB 00000000 IFB$L_RNS_LEN 00000000.7B129C98 IFB$L_HBK 00000000 00000000.7B129C9C IFB$L_EBK 00000001 00000000.7B129CA0 IFB$L_SFSB_PTR 00000000 00000000.7B129CA4 IFB$L_GBSB_PTR 00000000 00000000.7B129CA8 IFB$L_PAR_LOCK_ID 00000000 00000000.7B129CAC IFB$L_AVLCL 00000001 00000000.7B129CB0 IFB$L_GBH_PTR 00000000 00000000.7B129CB4 IFB$L_AS_DEV 144D4008 00000000.7B129CB8 00000000 00000000.7B129CBC IFB$L_ASDEVBSIZ 00000200 00000000.7B129CC0 IFB$L_DEVCHAR2 21010281 00000000.7B129CC4 IFB$L_BLBFLNK 00000000 00000000.7B129CC8 IFB$L_BLBBLNK 00000000 00000000.7B129CCC IFB$B_JNLFLG 00 00000000.7B129CCD IFB$B_RECVRFLGS 00 00000000.7B129CCE IFB$B_JNLFLG2 00 00000000.7B129CCF IFB$B_JOURNAL 00 00000000.7B129CD0 IFB$L_AI_JFB 00000000 00000000.7B129CD4 IFB$L_BI_JFB 00000000 00000000.7B129CD8 IFB$L_AT_JFB 00000000 00000000.7B129CDC IFB$L_RUFB_LNK 00000000 00000000.7B129CE0 IFB$W_BUFFER_OFFSET 0000 00000000.7B129CE2 IFB$B_RU_ACTIVE 00 00000000.7B129CE3 IFB$B_CXT_LEVEL 00 00000000.7B129CE4 IFB$L_RU_HANDLE 00000000 00000000.7B129CE8 IFB$L_EXTJNLBUF 00000000 00000000.7B129CEC IFB$W_CXT_FLAGS 0004 00000000.7B129CEE IFB$W_CXT_FILL 0000 00000000.7B129CF0 IFB$L_CXT0_PTR 00000000 00000000.7B129CF4 IFB$L_CXT1_PTR 00000000 00000000.7B129CF8 IFB$L_CXT0 00000000 00000000.7B129CFC IFB$L_CXT1 00000000 00000000.7B129D00 IFB$L_BDB_REUSE_COUNT 00000000 00000000.7B129D04 IFB$L_BKPBITSEXT 00000000 IFB$R_BKPBITSEXT_BITS0 IFB$R_BKPBITSEXT_OVERLAY 00000000.7B129D08 IFB$Q_RECORD_COUNT 00000000 00000000.7B129D0C 00000000 00000000.7B129D10 IFB$Q_USER_DATA_BYTES 00000000 00000000.7B129D14 00000000 00000000.7B129D18 IFB$L_IDX_PTR 00000000 IFB$L_MRN 00000000.7B129D1C IFB$B_AVBN 00 IFB$L_DVBN 00000000.7B129D1D IFB$B_AMAX 00 00000000.7B129D1E IFB$B_NUM_KEYS 00 00000000.7B129D1F IFB$B_UBUFSZ 00 00000000.7B129D20 IFB$W_KBUFSZ 0000 00000000.7B129D22 00 00000000.7B129D23 IFB$B_PLG_VER 00 00000000.7B129D24 IFB$L_EXTRABUF 00000000 00000000.7B129D28 IFB$W_COLVBN 0000 There are ample other pointers you can get involved with but this is the crux of the PPF internals. Gotta run... -- VAXman- OpenVMS APE certification number: AAA-0001 VAXman@TMESIS.COM