- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Get open files and username
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2005 09:49 PM
тАО12-11-2005 09:49 PM
i have to write some fortran 90 programs. i want to check if a file is already open and which user has it open. in fortran i have no idea how to handle it. is there a possibility in vms to check if the specified file is open and to get the user? i can see the open files with show device dsa2:/files, but i need the information in a program. any idea? thanks for your help!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2005 10:43 PM
тАО12-11-2005 10:43 PM
SolutionIf the environment is under your control, how about using the lock manager to communicate across nodes - the lock value block can easily hold a PID and SYS$GETJPI[W]() work cluster-wide for many item codes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-11-2005 11:53 PM
тАО12-11-2005 11:53 PM
Re: Get open files and username
Have a look at the FILES_INFO package at
http://vms.process.com/scripts/fileserv/fileserv.com?FILES_INFO
It's pretty old (1992) and written in C and Macro, but maybe it gives you a few ideas on how to do this in Fortran.
Regards,
Kris (aka Qkcl)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-12-2005 06:52 AM
тАО12-12-2005 06:52 AM
Re: Get open files and username
To find out whether a file is open is trivial. Just try opening it exclusively (NOT shared) and if that fails with a sharing violation then it must have been open!
Now to find out who, in the cluster, has it open is much, much, more difficult. The easiest route is probably a GETLKI hunting for the lock corresponding with the file and listing the PID... on each node.
If it is part of your application, then you may be better of defining your open file open registration method. For example, you could define your own 'file lock' with the last accessor pid, node and maybe username in the (16 bytes only) lock value block.
hth,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-12-2005 06:30 PM
тАО12-12-2005 06:30 PM
Re: Get open files and username
Do a show device/file/nosys to an output file on each cluster member (via sysman), then search the output files for the file.
Will give every process that has a current channel to the file, irrespective of whether the process has taken a lock or not.
Peejay
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If it can't be done with a VT220, who needs it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-15-2005 01:33 AM
тАО12-15-2005 01:33 AM
Re: Get open files and username
with a dcl command no problem: search file.txt string, but how to do this in a fortran program???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-15-2005 01:51 AM
тАО12-15-2005 01:51 AM
Re: Get open files and username
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-15-2005 01:55 AM
тАО12-15-2005 01:55 AM
Re: Get open files and username
Open the file
Loop reading record by record until EOF
is the search string in this record ?
if yes , go process , else continue loop.
The VMS run-time library offers a routine
STR$FIND_FIRST_SUBSTRING
see HELP RTL STR$ .
Use the file-name as the search string. If it matches, take the processname or processID from the beginning of the matched record to identify the process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-15-2005 05:33 PM
тАО12-15-2005 05:33 PM