Solved

How to know if a file copy is in progress ?

Posted on 2008-06-24
5
455 Views
Last Modified: 2013-11-20
Hello every body,

In an application written using VC++2005 with MFC support, is there a way to know if a file copy is in progress (some where else in windows, not especially in my application) ?

Thanks in advance,
Mike
0
Comment
Question by:mike_marquet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 40

Expert Comment

by:evilrix
ID: 21854247
Suggestion: Try to obtain an exclusive lock on the file, if you can't it's probably being modified.
http://msdn.microsoft.com/en-us/library/aa365203(VS.85).aspx
0
 

Author Comment

by:mike_marquet
ID: 21854525
It's not want I want. I don't know anything about the file.
I only want to know if a FileCopy is somewhere in progress what else which file is being copied.
0
 
LVL 40

Expert Comment

by:evilrix
ID: 21854538
Oh, ok. I might help to know why you want to do this -- what's the rational? There might be a different way to approach this.
0
 

Author Comment

by:mike_marquet
ID: 21854656
If a file copy is in progress, I must disable some controls in my application.
0
 
LVL 19

Accepted Solution

by:
mrwad99 earned 50 total points
ID: 21858088
At first thought you would need to hook the API functions CopyFile and CopyFileEx, as I would imagine most copying on the system would employ one of those API functions.  Wait for the function to exit, then you know the copy has been completed so you can enable your controls.

That said, I don't know much about it myself, although if you look hard enough I am sure there is some info out there about hooking API function calls.

HTH
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question