- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Error in openning file
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-04-2008 09:45 AM
08-04-2008 09:45 AM
Error in openning file
1:
ifstream fileStream;
fileStream.open(fileName, ios::in);
if (fileStream.fail()){
return 1;
}
2:
ofstream fileStream;
fileStream.open(fileName, ios::out|ios::trunc);
if (fileStream.fail()){
return 1;
}
Actually file exists, user is file's owner and file has permissions 777. I cannot understand why in this case it is impossible to read or write a file. Do you have any ideas?
I have a some suggestions, but I'm not sure about them:
1) File is busy by another process. Is it possible? If yes, is there a command which I can use for monitoring which processes use my file? But it seems there are no another processes interested in this file.
2) There are some system limitations for files (like limitations from file system). Is it possible? If yes, what are these limitations and can I check them by some commands?
3) There are some process limitations for opened files. Is it possible? If yes, how I can check them?
4) Any another ideas?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2008 10:35 AM
08-04-2008 10:35 AM
Re: Error in openning file
knowledge, but even a clod like me will try
to learn the cause of a failure from the OS.
Sonething like "errno", as I recall. Perhaps
C++ has something similar which might be
informative. This often works better than
guessing possible reasons for an I/O failure
with no clues.
Perhaps I've missed them but I don't see a
few insignificant details in your problem
report (other than a complete failing test
case), such as:
The file name used by the program (which
could be invalid).
Ownership and permissions of the
directory where this file might be sought
(or created)
The OS and its version, or the compiler
snd its version.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2008 11:04 AM
08-04-2008 11:04 AM
Re: Error in openning file
HP-UX doesn't enforce checking like that.
2>) There are some system limitations for files
Yes, too many inodes open. See nfile(5).
>3) There are some process limitations for opened files.
Yes, too many files open per process.
What does "ulimit -a" show?
>4) Any another ideas?
What Steven said about printing errno.
Also what compiler and OS version are you using?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2008 11:15 AM
08-06-2008 11:15 AM
Re: Error in openning file
> could be invalid).
file name is ok. But I will recheck it tomorrow. Actually, problem happened on a customer side
> Ownership and permissions of the
> directory where this file might be sought
> (or created)
ownership of directory is the same of process'es ids (effective and real)
> The OS and its version, or the compiler
> snd its version.
aCC: HP ANSI C++ B3910B A.03.63
HP-UX 11.11 32 bit
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2008 11:19 AM
08-06-2008 11:19 AM
Re: Error in openning file
>
>Yes, too many inodes open. See nfile(5).
unfortunately, utility nfile doesn't exist on that HP-UX instance.
>>3) There are some process limitations for >opened files.
>
>Yes, too many files open per process.
>What does "ulimit -a" show?
Let me check this output.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2008 09:44 PM
08-06-2008 09:44 PM
Re: Error in openning file
What utility? nfile(5) says look at the man page in section 5.
You can use sar(1m) for the inod-sz:
$ sar -v 1 5
22:42:20 text-sz ov proc-sz ov inod-sz ov file-sz ov
22:42:21 N/A N/A 179/4200 0 822/156532 0 569/65536 0