Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
File Access/Lock Checking
Name: MeatPopsicle Date: June 7, 2004 at 12:07:20 Pacific OS: VMS 7.1-2 CPU/Ram: ???
Comment:
Does anyone have any clever scripts that will take a filename as an argument and return the process ID(s) or username(s) of anyone accessing or locking that file? Can such a beast be done? I've looked into DECamds, but cannot see a way to build a command line procedure to find this information. Thanks!
Name: VMSFan Date: June 7, 2004 at 15:13:49 Pacific
Reply:
Use ANALYZE; dump desired results to a text file and search it. Example:
$ IF ( P1 .EQS. "" ) THEN P1 = ";" ! show all files by default $ ANALYZE /SYSTEM SET OUTPUT ANA_SYS.TMP SHOW PROCESS ALL /CHANNEL EXIT $ SEARCH ANA_SYS.TMP /OUTPUT=FILE_LIST.TXT "Extended PID"+'P1' $ DELETE ANA_SYS.TMP; $ TYPE FILE_LIST.TXT
0
Response Number 2
Name: WillemGrooters Date: June 9, 2004 at 06:29:15 Pacific
Reply:
Access can be done easier and without privileges (that you need to use ANALYZE/SYSTEM)
You'll get all the info you need by:
SHOW DEVICE/FILES/OUTPUT= FILE_LIST.TXT
To see who locks the file, you'll need ANALYZE/SYSTEM the way described before. But mostly, access list is enough.
Summary: In Win or Linux an opened file could be copied to another location. Now I want to do the same in Open VMS and I haven't any ideea. I can't get lost the error message saying that the file is locked by ...
Summary: There's a lot more on error handling. above possibilities are a brute_exit I would not suggest - nor allow them on my system! It won't tell me ANYTHING on what went wrong. Ok. ANY executed image will ...
Summary: If you're willing to recompile then use the synchronous version of the deq (sys$deqw) instead. You're likely exiting before the request completes which can terminate the request (image run down). Yo...