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


monitor if a specific file is accessed

Posted on 2005-03-08
Medium Priority
Last Modified: 2010-04-01
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
Question by:jpreis
  • 3
LVL 30

Accepted Solution

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 :-)
LVL 30

Expert Comment

ID: 13490446
LVL 30

Expert Comment

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

Author Comment

ID: 13901879

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.


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