HP3000-L Archives

July 1995, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Paul H. Christidis" <[log in to unmask]>
Reply To:
Date:
Wed, 26 Jul 1995 19:17:12 PST8
Content-Type:
text/plain
Parts/Attachments:
text/plain (31 lines)
>Hi all,
>Is there any way for a user process to get the actual name of an open
>data base? I'm looking for the fully-qualified MPE filename of the root
>file that was actually opened.
 
>-- Bruce
 
There are a couple of ways but they require privileged mode:
 
1.      getprivmode;   <<root file's file code is -400>>
        fnumber := fopen (DBname,1,,,,,,,,,,,-400);
        if fnumber <> 0 then
          begin
            fgetinfo (fnumber,MPE'file'name);
            fclose (fnumber,0,0);
          end;
        getusermode;
 
NOTE! There is the danger that someone could issue a file equation:
        :file XYZDB;DEL
      and the above code would purge the root file.
 
 
2.  If you only have ONE database in your process then you could cycle
through the list of open files ( 3 >fnum>max'fnum) again in priv mode until
you encounter a file with -400 as the file code.
 
Regards
 
Paul H. Christidis

ATOM RSS1 RSS2