Excuse me for being in a rush and not having time to develop a sample, but I 
think what you want to do can be determined using WMI, in the CIM_Datafile 
class, there is a property named InUseCount:

http://msdn.microsoft.com/en-us/library/aa387236(VS.85).aspx

http://www.slideshare.net/ddn123456/win32-perl-wmi (Haven't checked that one 
out, but it says it is an introduction to using Perl and WMI)

http://forums.cacti.net/about5816.html (Contains an example of using WMI in 
Perl).

Almost all properties of windows objects can be found in some WMI class. You 
can also connect to remote machines and run WQL queries against those machines, 
so it is not just for local machines.

If needed, I'll see if I can provide an example when I get off work today. 
Hopefully, this gets you going in the right direction.


From: [email protected] 
[mailto:[email protected]] On Behalf Of Jason 
Lowder
Sent: Thursday, February 18, 2010 7:20 AM
To: [email protected]
Subject: Re: Determining if a file is open

And yes, this is under Windows. (Vista)

Jason

On 2/18/2010 8:38 AM, Jason Lowder wrote:

Hello,



Is there anyway to determine if a file is currently open by another

process?  I want to look at a file that is being generated by another

program (sometimes a very large file) and determine when it is finally

closed.



I see the file attributes for things like size, owner, type etc. but

nothing to really determine it's state.



Thanks,



Jason

_______________________________________________

Perl-Win32-Users mailing list

[email protected]<mailto:[email protected]>

To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs







No virus found in this incoming message.

Checked by AVG - www.avg.com<http://www.avg.com>

Version: 9.0.733 / Virus Database: 271.1.1/2693 - Release Date: 02/17/10 
01:35:00




_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to