- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Is the file being accessed
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
02-22-2002 03:52 AM
02-22-2002 03:52 AM
Is the file being accessed
Is there a 100% reliable method to checking if a file is being accessed in any way before moving or copying it, to ensure that you are moving or copying a file that is not still growing or changing.
Thanks,
Dermot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2002 04:06 AM
02-22-2002 04:06 AM
Re: Is the file being accessed
Try "lsof filename". This can be downloaded from:
http://hpux.connect.org.uk/hppd/hpux/Sysadmin/lsof-4.61/
or other porting sites.
Rgds, Robin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2002 05:29 AM
02-22-2002 05:29 AM
Re: Is the file being accessed
The standard UNIX command is fuser:
fuser /filename
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2002 05:50 AM
02-22-2002 05:50 AM
Re: Is the file being accessed
As Robin has noted, lsof is the best tool to use not only for who has what file open, put it can be used to view what sockets users have open also.
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2002 05:55 AM
02-22-2002 05:55 AM
Re: Is the file being accessed
Thanks again,
Dermot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2002 06:19 AM
02-22-2002 06:19 AM
Re: Is the file being accessed
If you are talking just HP-UX then I would seriously look at lsof. It is FREE and there are versions available for all current versions of HP-UX. Yes, you do have to install it on each machine, but it is a tool that no one should be without anyway.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2002 07:40 AM
02-22-2002 07:40 AM
Re: Is the file being accessed
As said, lsof is a better tool than fuser however fuser should tell you if the file is being accessed. I don't know why it would not be reliable.
You'll have to take into account how the file is being written. Nothing is fool-proof if the file is opened, written to, closed, then re-opened in append mode. Does ftp do that? I don't know. Can I append to a file after it has been written then closed? Absolutely.
Darrell