473,756 Members | 2,383 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

File monitoring for all drive

hi
i want to detect all file change operations(rena me,delete,creat e....)
on ALL THE DRIVES of the hard disk
using the method ReadDirectoryCh anges API , i.e program no. 3 in the
webpage http://tgolden.sc.sabren.com/python/...r_changes.html
..
Please suggest some modification to the program so that i can detect
changes to ALL the drives
(to detect changes on c:\ set
path_to_watch = "." to "c:\\" but this works for only one drive

thanks
rohit

May 24 '07 #1
3 3697
rohit wrote:
hi
i want to detect all file change operations(rena me,delete,creat e....)
on ALL THE DRIVES of the hard disk
using the method ReadDirectoryCh anges API , i.e program no. 3 in the
webpage http://tgolden.sc.sabren.com/python/...r_changes.html
.
Please suggest some modification to the program so that i can detect
changes to ALL the drives
(to detect changes on c:\ set
path_to_watch = "." to "c:\\" but this works for only one drive
Well, to answer the question specifically: since the
Windows filesstem has no concept of a "root" above
the drive letters, the simplest thing to do is to
kick off a thread or a subprocess or what-have-you
for each drive letter.

The *shell* has the concept of a "My Computer" which
notionally sits above the various drives, but since
it isn't itself a drive and since I assume you're
only interested in local drives anyway and not the
rest of the shell-y stuff which sits underneath it,
you'd end up querying for local drives and going
the same path in any case.

TJG
May 25 '07 #2
rohit wrote:
hi
i want to detect all file change operations(rena me,delete,creat e....)
on ALL THE DRIVES of the hard disk
But to go a little further than your question... are
you sure you want to do this? It's going to put quite
a load on your system and be not-very-scaleable. I
haven't yet had a chance to look into the NTFS
Change Journal, but that might be a better way to
go. Search this group for previous suggestions of
this sort (from me and others).

TJG
May 25 '07 #3
[rohit]
>>i want to detect all file change operations(rena me,delete,creat e....)
on ALL THE DRIVES of the hard disk
using the method ReadDirectoryCh anges API , i.e program no. 3 in the
webpagehttp ://tgolden.sc.sabr en.com/python/win32_how_do_i/watch_directory _fo...
.
Please suggest some modification to the program so that i can detect
changes to ALL the drives
(to detect changes on c:\ set
path_to_wat ch = "." to "c:\\" but this works for only one drive
[Tim Golden]
>Well, to answer the question specifically: since the
Windows filesstem has no concept of a "root" above
the drive letters, the simplest thing to do is to
kick off a thread or a subprocess or what-have-you
for each drive letter.
[rohit]
actually i want to implement a deamon monitoring file changes on the
system
so u suggesting i should implement the program with multithreading to
include all drives?
That's one possibility, but again I'd ask whether
this is really quite sane: you're asking the filesystem
to tell you about every change to every file on the
system which will naturally slow things down. It will
get even more complicated if you're actually storing
these "change logs" in a file somewhere, since that
will then fire the monitoring mechanism itself!

I suggest - again - that the NTFS change journal might
be better suited to what you're trying to do.

Try the threaded approach with the ReadDirectoryCh anges
API *on a small area of disk* to see how well it scales.
Then you'll be better placed to decide if it will work
well across all the disks in the system.

TJG
May 27 '07 #4

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

Similar topics

1
3890
by: Ron | last post by:
I am trying to run asp.net pages. The server is accessed via http://sitename/username I have verified it is using port 80 and aspx extensions are configured. But when I run and asp.net page I get the following error: Invalid file name for monitoring: 'E:\'. File names for monitoring must have absolute paths, and no wildcards. Description: An unhandled exception occurred during the
0
1484
by: simpsoro | last post by:
I am trying to run asp.net pages. The server is accessed by students via http://sitename/username I have verified it is using port 80 and aspx extensions are configured. But when I run and asp.net page I get the following error: Invalid file name for monitoring: 'E:\'. File names for monitoring must have absolute paths, and no wildcards. Description: An unhandled exception occurred during the
12
15919
by: Anders Eriksson | last post by:
Hello! I'm trying to create a program that will watch a directory and when a file is created print that file. I have used FileSystemWatcher for watching the directory and I get an created event. The problem is that I don't know when the file is complete when using Explorer copy or move. I have tried to use FileIOPermission but I always get that the file is
1
6129
by: Edward Yang | last post by:
I setup web.config with impersonation="true". On our local server the project works great. I did the same procedures on our staging server, but it failed with an impossible error: Server Error in '/' Application. -------------------------------------------------------------------------------- Access denied to 'C:\Inetpub\wwwroot\myapp\default.aspx'. Failed to start monitoring file changes. Description: An unhandled exception occurred...
7
13406
by: Mark | last post by:
Hello, I have researched and tried every thing I have found on the web, in groups and MS KB articles. Here is what I have. I have a Windows 2000 Domain Controller all service packs and every thing else from windows update. ..NET 1.0 and 1.1 installed on the server. Actually .NET was installed before the server was made a DC.
0
1620
by: Ron Simpson | last post by:
I am trying to run asp.net pages. The server is accessed via http://sitename/username I have verified it is using port 80 and aspx extensions are configured. But when I run and asp.net page I get the following error: Invalid file name for monitoring: 'E:\'. File names for monitoring must have absolute paths, and no wildcards. Description: An unhandled exception occurred during the
0
1666
by: Seth | last post by:
For some reason my service works fine except that it will create the file in my c drive, but will not write to the file. Sorry if this is a duplicate post, i have found some that ask the same question - but noone seems to answer. Do i need to do anything specific to write to a text file from a windows service, much appreciated.
5
483
by: Joe | last post by:
I'm getting the following error when trying to call a page on a secure server. I'm not doing any impersonations or file access of any kind. The page is using PayPal and I'm wondering if PayPal has something to do with this. We had to register an api certificate on the server using WinHttpCertCfg. Maybe this is doing something? Access denied to 'D:\WWWRoot\sslserver'. Failed to start monitoring file changes. Description: An unhandled...
0
1165
by: mr t | last post by:
Is there anyway to turn off visual studio file monitoring? It is interfering with my web application debugging. here is a problem: sometimes, BUT NOT ALL THE TIMES, when I create a directory using system.io.directory.create , in a web application, when i call system.io.directory.delete(filename, true), an exception is thrown that the directory is not empty. notice that I have added 'true' for recursive delete. when I close visual...
0
9456
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10034
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9713
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8713
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7248
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5142
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.