Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

monitor if a specific file is accessed

Posted on 2005-03-08
5
Medium Priority
?
229 Views
Last Modified: 2010-04-01
Hi
I'm trying to make a program detect when a specific file is accessed (i was thinking of monitoring changes in the lastaccessed attributes) and whenever that happens it should run another program (like a prog.bat) . I'm programming with visual c++ 6.0. Any sugestions? thanks
0
Comment
Question by:jpreis
  • 3
4 Comments
 
LVL 30

Accepted Solution

by:
Axter earned 750 total points
ID: 13490405
Hi jpreis,

I recommend you use the Windows API functions that can do this for you.
See ReadDirectoryChangesW or FindFirstChangeNotification API functions

David Maisonave :-)
Cheers!
0
 
LVL 30

Expert Comment

by:Axter
ID: 13490446
0
 
LVL 30

Expert Comment

by:Axter
ID: 13490505
here's a wrapper class along with some sample code: http://www.codeproject.com/file/directorychangewatcher.asp
0
 

Author Comment

by:jpreis
ID: 13901879
Axter,

thank you for that answer. i completly forgot about this question because i managed to get around that problem. i'm rewarding you for the atention though.

thanks
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

580 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