HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Locking a file by same process
Operating System - HP-UX
1833589
Members
3759
Online
110061
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
06-01-2002 01:08 AM
06-01-2002 01:08 AM
Locking a file by same process
Hi
My requirement is , when I give two subsequent open statements opening the same file I want my second open statement to fail saying that the file is already opened.ie. I don't want sharing facility.In AIX we have a flag O_NSHARE in open statement which solves my problem ,In HP 11 this provision is not there.
So if anyone knew please do give me the solution as early as possible.
Regards
Tharangini
My requirement is , when I give two subsequent open statements opening the same file I want my second open statement to fail saying that the file is already opened.ie. I don't want sharing facility.In AIX we have a flag O_NSHARE in open statement which solves my problem ,In HP 11 this provision is not there.
So if anyone knew please do give me the solution as early as possible.
Regards
Tharangini
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2002 05:18 AM
06-01-2002 05:18 AM
Re: Locking a file by same process
Hi,
under whihch UID do you run your program? Usually "root" does not care about file and record locks...
Just an idea,
Wodisch
under whihch UID do you run your program? Usually "root" does not care about file and record locks...
Just an idea,
Wodisch
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2002 07:54 AM
06-01-2002 07:54 AM
Re: Locking a file by same process
HP-UX is not AIX and in fact you are using a non-standard UNIX feature. File locking has always been the responsibility of the programmer. You can change your code to use lockf() to test for locks.
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2002 01:29 PM
06-01-2002 01:29 PM
Re: Locking a file by same process
Plan B.
If this is the same process, why not simply use a variable to indicate that you already have the file open.
If this is the same process, why not simply use a variable to indicate that you already have the file open.
If it ain't broke, I can fix that.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP