- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: File locked
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
Forums
Discussions
Discussions
Discussions
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
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
08-13-2007 09:09 AM
08-13-2007 09:09 AM
I am running OpenVMS 7.3-2 and I recently wrote a script.
Users have submitted this as a queue using the submit command which is normally done with other scripts often used in our lab.
However, the first couple of entries ran fine. However, later on an error was reported stating
"File (the script file) locked by another user"??
%DCL-E-OPENIN, error opening DISK1:[XXXXX.XXXX]TEMP_XXX.COM; as input
-RMS-E-FLK, file currently locked by another user
Why does this kind of error occur and how can we correct for this problem ?
Could this be because the file has been left open ? by a user or are their file security issues.
Some details would be very helpful if this is indeed a simple answer.
In case more information is required can you please let me know what that would be and what commands should I use to get the same.
thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2007 09:48 AM
08-13-2007 09:48 AM
Re: File locked
Try $ show dev/files disk1 and look for the file name.
Better
$ pipe show dev/files disk1 | sea sys$input temp_xxx.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2007 10:24 AM
08-13-2007 10:24 AM
Re: File locked
actual commands and actual output instead of
vague descriptions and edited output.
Unless, of course, you really have a
directory named "[XXXXX.XXXX]", and a
procedure named "TEMP_XXX.COM".
> "File (the script file) locked by another
> user"??
You mean that _your_ procedure is named
"TEMP_XXX.COM"? From that name, I'd have
guessed that your procedure (whatever it's
called) creates a _temporary_ file named
"TEMP_XXX.COM", and when you run it twice at
the same time, both jobs use the same
temporary file name, and _that's_ what's
causing the file access conflict. If that
were the case, I'd suggest incorporating the
process ID (f$getjpi( "", "PID")) in the
temporary file name to avoid that sort of
collision.
However, we can't see your procedure, and we
can't see what it really did, so it's not
easy to say (with any confidence) what went
wrong.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2007 10:44 AM
08-13-2007 10:44 AM
SolutionIf you're working with a scratch area, you either need to use unique filenames, or you need to use unique scratch areas.
I tend to redefine SYS$SCRATCH, and toss the temporary files over there.
Here's some troubleshooting info:
http://64.223.189.234/node/217
There's a case where you can get into trouble with an exit path -- where the file isn't closed -- and this can manifest itself in several ways. To avoid this at run-time...
If you're using a DCL command such as the following:
OPEN/WRITE foo filename
Issue the following command just before the OPEN:
CLOSE/NOLOG foo
http://64.223.189.234/node/383
And within the application procedure itself, ensure the procedure closes the file on the way out.
If you're intending to share the file, use the /SHARE qualifier on the open.
There's a write-up on sharing file access from within C -- the C extensions related to file locking and file sharing -- available within the OpenVMS FAQ.
http://www.hoffmanlabs.com/vmsfaq/
The details are easier to find within the text or PDF versions. HTML is hard to search.
And the DCL command SHOW DEVICE ddcu:/FILE will show you which process has the file opened on the particular device, as was mentioned previously in this thread.
Stephen Hoffman
HoffmanLabs LLC
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2007 03:02 AM
08-15-2007 03:02 AM
Re: File locked
OpenVMS Developer & System Manager
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2007 03:32 AM
08-16-2007 03:32 AM
Re: File locked
The file was locked because it was being used by multiple users. Thanks for your feedback Hoff.
I corrected that by using F$search lexical to search and create a specific com file for every execution and deleting the specific version of the file in the end to resolve any ambiguities.
This took care of things in a nice and neat manner.