473,387 Members | 1,534 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Which process has a file open

Is there a windows API call which will tell me which process has a file open?
Nov 17 '05 #1
5 1316
>Is there a windows API call which will tell me which process has a file open?

George,

As far as I know there's no simple API call to do this. If you want a
utility that will do it, have a look at the excellent Process Explorer
tool at www.sysinternals.com

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 17 '05 #2


"David Lowndes" wrote:
Is there a windows API call which will tell me which process has a file open?


George,

As far as I know there's no simple API call to do this. If you want a
utility that will do it, have a look at the excellent Process Explorer
tool at www.sysinternals.com

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq

Thanks, That will get me what I need.

George
Nov 17 '05 #3
Hello David,
Is there a windows API call which will tell me which process has a
file open?
As far as I know there's no simple API call to do this. If you want a
utility that will do it, have a look at the excellent Process Explorer
tool at www.sysinternals.com


It's not that hard. See explanations and examples there
http://www.codeguru.com/Cpp/W-P/syst...cle.php/c2827/
http://www.codeguru.com/Cpp/W-P/file...cle.php/c1287/

Nov 17 '05 #4
>It's not that hard.

It can't be that straightforward either when that article contains a
warning like this:

"This software uses a few undocumented functions (ntdll.dll), peeks
around in your systems internals. Use at your own risk! It works for
me".

:)

Dave
Nov 17 '05 #5

"David Lowndes" <da****@example.invalid> wrote in message
news:r5********************************@4ax.com...
It's not that hard.


It can't be that straightforward either when that article contains a
warning like this:

"This software uses a few undocumented functions (ntdll.dll), peeks
around in your systems internals. Use at your own risk! It works for
me".

:)

Dave


Which are the same internal API's used by sysinternals Process Explorer :-)

Willy.
Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: trellow | last post by:
Hello, I am writing an application that needs to read a file that is already open by another process for writing. When I do the following: FileStream fs = new FileStream(fileName,...
0
by: Lin JinCong | last post by:
Dim p As Process = System.Diagnostics.Process.Start(filename) p.WaitForExit() Open a file use above method, and use WaitForExit method to wait, when file is MS Word file, p equal to nothing....
5
by: Dino Buljubasic | last post by:
My application can allow a user to open a file for viewing by fetching file data from database, creating the file in a temp directory and starting appropriate process (i.e. Adobe or any other...
0
by: bazzer | last post by:
hey, im trying to access a microsoft access database from an ASP.NET web application in visual basic 2003.NET. i get the following error when i try running it: Server Error in...
4
by: Paddy | last post by:
We have a recurring problem where a (long-running) service throws an exception while trying to access a file. The problem is that this is very rare (happens once every week and without warning) but...
13
by: George | last post by:
Hi, I am re-writing part of my application using C#. This application starts another process which execute a "legacy" program. This legacy program writes to a log file and before it ends, it...
0
by: Francois Stander | last post by:
ASP (VB.net) Good day. I re-use the same file name for sms information which gets uploaded to a FTP (sms) server. The file name is every time closed (seems this is not the case) When trying to re do...
7
by: jonathandrott | last post by:
sorry newbie question probably. i'm trying to open an specific folder. open each file with in the folder individually and process each one. all the processing code has been written. i'm looking...
9
by: Carl | last post by:
Hi Is it possible to find out if another process is using a paticular file (xml)? There does not seem to be anything useful in the File och Filestream class for this purpose. regards Carl
8
by: Lonifasiko | last post by:
Hi, Using Process class I asynchronously launch an executable (black box executable) file from my Windows application. I mean asynchronously because I've got an EventHandler for "Exited" event....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.