Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

how do I read a file that is flagged as locked

SOLVED
Go to solution
Kirk Reindl
Frequent Advisor

how do I read a file that is flagged as locked

OpenVMS 7.3-1
2-node cluster on ES40 hardware.

Can anyone tell me how I can read a file that is locked?? For instance:

I want to examine the following pathworks log file:

pwrk$logs:PWRK$MASTER_OSIJX2.LOG

If I do a:
set proc/priv=all
OSIJX2> edit /read PWRK$MASTER_OSIJX2.LOG
%EDT-F-OPENIN, error opening PWRK$COMMONROOT:[LOGS]PWRK$MASTER_OSIJX2.LOG; as input
-RMS-E-FLK, file currently locked by another user

OSIJX2> type PWRK$MASTER_OSIJX2.LOG
%TYPE-W-OPENIN, error opening PWRK$COMMONROOT:[LOGS]PWRK$MASTER_OSIJX2.LOG;166 as input
-RMS-E-FLK, file currently locked by another user
OSIJX2>

I'd just like to read it, not edit it.
Thanks
Kirk
10 REPLIES
Hein van den Heuvel
Honored Contributor

Re: how do I read a file that is flagged as locked


Your best bet: BACKU/IGNORE=INTERLOCK

Please note that the writer did NOT expect sharing, even prohibitied it. So the RMS function in the writer process is just filling buffers (8KB or 16KB or whatever SHOW RMS tells you) and NOT flushing out to disk. Even if it flushes the data as buffers get filled and re-used it will NOT update the exact EOF and it will heppily write a partial record. The next write will write the end of that partial.

So you may need an set file/end on the output from backup/ignore=inter and you may well end up with junk at some arbretrary multple of 8192 bytes.

Good luck!

Hein.



Volker Halle
Honored Contributor

Re: how do I read a file that is flagged as locked

Kirk,

you're using the EDT editor. Try using TPU:

$ EDIT/TPU/READ PWRK$MASTER_OSIJX2.LOG

If you prefer the EDT keypad in TPU - as I do - add DEFINE/JOB EVE$KEYPAD EDT to your LOGIN.COM.

TPU is better regarding the reading of files opened for write by another user (best example is OPERATOR.LOG)

If TPU can't open the file, then try the BACK/IGN=INTERLOCK method described by Hein.

Volker.
Jan van den Ende
Honored Contributor

Re: how do I read a file that is flagged as locked

And, just for completeness, remember the same restrictions about the data already/not yet written as described by Hein also applies to Volker's solution, with the extra restriction that you CANNOT do the SET FILE/END

hth,

Jan
Don't rust yours pelled jacker to fine doll missed aches.
Mobeen_1
Esteemed Contributor

Re: how do I read a file that is flagged as locked

Kirk,
As many have mentioned here use the tpu editor. I have tried this with another file that was locked and it works

Try this....

OSIJX2> ed/tpu/read PWRK$MASTER_OSIJX2.LOG;

rgds
Mobeen
Wim Van den Wyngaert
Honored Contributor

Re: how do I read a file that is flagged as locked

Files not accessed by other processes can be vieuwed with any tool.
If the file is open in shared mode allowing readers, edt no longer works. TPU does.
If the file is exclusively open, all tools including tpu stop working except backup/ign=int.

Wim
Wim
Hein van den Heuvel
Honored Contributor

Re: how do I read a file that is flagged as locked


Kirk showed TYPE also failing, so I assume(d) that TPU woudl also fail.

On other tool well worth a try is: CONVERT/SHARE.
That will work nicely for cases where the original opener allows readers but not writers. Best I recall it uses the UPI open option though and may not see the right EOF.


Hein.
Doug Phillips
Trusted Contributor
Solution

Re: how do I read a file that is flagged as locked

CONVERT/SHARE fails with this file as it is open exclusive.

Tracing the usage of this file, looking through old versions, I don't see why it is even open. It logs the PWRK$MASTER process startup and I've never seen anything in it from after that time. Pathworks does some strange things and the dozens of files it keeps open exclusive is a real PITA.

Here's what I see every version of the file:

$type pwrk$logs:PWRK$MASTER_TRULIN.LOG;-1

4-JUN-2004 10:46:25.22 00000229:002D7DC8 [eventlogger]
4-JUN-2004 10:46:25.44 00000229:002D7DC8 event_log_path = PWRK$COMMON:EVTLOGT
4-JUN-2004 10:46:25.44 00000229:002D7DC8 LIB_CSStartup: CS startup initiated f9
4-JUN-2004 10:46:25.53 00000229:002D7DC8 LIBMEM_init: intialised 16 lookaside l
4-JUN-2004 10:46:25.53 00000229:002D7DC8 [servers]
4-JUN-2004 10:46:25.53 00000229:002D7DC8 lanmanager = yes
4-JUN-2004 10:46:25.56 00000229:002D7DC8 PCM_init: initializing distributed da0
4-JUN-2004 10:46:25.56 00000229:002D7DC8 PFS_configure: loaded data cache 4-JUN-2004 10:46:25.64 00000229:002D7DC8 PFS_configure: loaded dynamic library0
4-JUN-2004 10:46:25.64 00000229:002D7DC8 PFS library, version 17.1 configured,0
4-JUN-2004 10:46:25.64 00000229:002D7DC8 PFS_getusage: check ODS2 File System,5
4-JUN-2004 10:46:25.64 00000229:002D7DC8 PFS_getusage: acquiring PCM usage inf
4-JUN-2004 10:46:25.64 00000229:002D7DC8 PFS_getusage: acquiring PCM usage inf
4-JUN-2004 10:46:25.64 00000229:002D7DC8 PFS_getusage: acquiring PCM usage inf


Doug
Antoniov.
Honored Contributor

Re: how do I read a file that is flagged as locked

Kirk,
what's your detailed trouble?
Reading PWRK$MASTER doesn't give you useful information; same for PWRK$MONITOR.
You can obtain some info from
$ ADMIN SHOW EVENT /SINCE=YESTERDAY
or else
$ ADMIN /ANALYZE /SINCE=YESTERDAY

Antonio Vigliotti
Antonio Maria Vigliotti
Kirk Reindl
Frequent Advisor

Re: how do I read a file that is flagged as locked

Thanks for all responses.

Sometimes I think I screw up when I issue points, please don't be offended.

I think it will make most sense if I open a new post with the Pathworks issue I'm having.
Thanks again, I did learn about how OVMS handles file locking.

Rgds,
Kirk
Dave Gudewicz
Valued Contributor

Re: how do I read a file that is flagged as locked

Hein is correct a few notes above.

TPU will not work with said file, although it does w/other seemingly locked files if, for example EDT fails.