- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to know when a file is opened by the syste...
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
10-18-2001 02:04 AM
10-18-2001 02:04 AM
I would like to know how can I be sure that a file is being used by the system.
Example: The system is generating a file but due to a high workload this file is not being actualized in 2 minutes. Externally it seems that the file system has finish because the file has no activity in 2 minutes but it is still opened to add more info when it is ready
Thank you in advanced
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2001 02:21 AM
10-18-2001 02:21 AM
SolutionI think youre going to have to use lsof. Download and install it.
Then, run lsof -ou
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2001 02:31 AM
10-18-2001 02:31 AM
Re: How to know when a file is opened by the system, not by an user
fuser will show you who has the file open, but I don't know that there is a way to detect whether there are any pending writes to the file. If the load is high on the system and the process has not gotten to the point of writing to the file, there is not way to detect that short of tracing the system calls made by the process (using tusc or the like).
-Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2001 03:33 AM
10-18-2001 03:33 AM
Re: How to know when a file is opened by the system, not by an user
It is also important to realize that many programs will use stdio(3S) routines, i.e. printf(3S) etc., to do the writing. stdio to a file is normally buffered. The standard buffer size (see BUFSIZ in setbuf(3S)) is 1024 bytes, i.e. unless/until the application has written 1024 bytes, the disk file will not be changed/written_to.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2001 03:43 AM
10-18-2001 03:43 AM
Re: How to know when a file is opened by the system, not by an user
I tried first with the lsof with that example:
I edited with vi a file called nohup.out
Then I did lsof | grep nohup but nothing appeared
Also I tried with lsof -ou root |grep nohup but same result
I'm still reading at the lsof man(was a new instruction for me)
With fuser same result, it doesn't show the file as used.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2001 04:00 AM
10-18-2001 04:00 AM
Re: How to know when a file is opened by the system, not by an user
dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-18-2001 08:08 AM
10-18-2001 08:08 AM
Re: How to know when a file is opened by the system, not by an user
if you do know the process having open that file, then the easiest answer seems to be GlancePlus: select that process, go for the "Open Files", and watch it until it vanishes from there (or the process dies).
Just my $0.02,
Wodisch