473,387 Members | 1,420 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.

monitor a folder for file creation, how?

How do I monitor a folder for new file(s) creation?
How to use thread to do a wait until a new file is 'detected'?

Thank you!
Jul 29 '05 #1
3 3175
fanbanlo <henryho@NO__SPAMM_.telus.net> writes:
How do I monitor a folder for new file(s) creation?
How to use thread to do a wait until a new file is 'detected'?


There's not a clean portable way to do this.

The portable way is to poll the update time of the folder at regular
intervals, and act when it changes. I did that for a Maildir mail
monitoring tool once, but can't seem to find the source now. Sorry.

The clean way depends on your platform. Most modern system have a
mechanism to get the kernel to notify you when a file/directory is
updated. But they are all different. Since you say "folder", I assume
you're on Windows - and I can't help you with this one.

<mike
--
Mike Meyer <mw*@mired.org> http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Jul 29 '05 #2
win32: (I posted this link in response to same question, um, day bef.
yesterday)

http://groups-beta.google.com/group/...008cb68eeffa23
(Thanks to Tim Golden for collecting the info)

OS X: I dunno...

Jul 29 '05 #3
SUPER! This is exactly what I'm looking for.

gene tani wrote:
win32: (I posted this link in response to same question, um, day bef.
yesterday)

http://groups-beta.google.com/group/...008cb68eeffa23
(Thanks to Tim Golden for collecting the info)

OS X: I dunno...

Jul 29 '05 #4

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

Similar topics

0
by: Mike Connor | last post by:
I am having trouble getting Conditional Folder creation & File insertion to work using VS .Net in a Deployment Project for a C# app. I am displaying a generic Textbox Dialog under the User...
5
by: Jon Maz | last post by:
Hi there, I am experimenting with the FileSystemWatcher object. I have set the NotifyFilter as follows: myFileSystemWatcher.NotifyFilter = NotifyFilters.Security | NotifyFilters.CreationTime...
4
by: Egil Hansen | last post by:
Hi all Do C# and .net have some way to monitor a folder in Windows XP/Windows 2000. I want to mirror the content of the folder, including subfolders (if any exsists) to another place, and I want...
1
by: Karunakaran | last post by:
Is there a way to allow asp.net to create a folder in remote server? Say if I give a path something like this: \\testserver\testfolder the asp.net application sould be able to create folder...
2
by: Mark | last post by:
I've heard that you could program a service to Manage File folders, etc. My problem is that I have to monitor files in a folder and when locks are released from them by users, move them to...
4
by: Rui | last post by:
Can I write a windows service in .NET that monitors what happens on a server? (e.g.. which applications where started, what files where accessed, registry changes,...)
2
by: TwistedPair | last post by:
All, This is sort of a continuation of a previous post of mine. The code below basically reads a registry key to get a path to a folder and it watches for files created in that folder (only...
11
by: jonathan184 | last post by:
Hi I am trying to do a script to monitor a dir where files pass through approx every 5 mins but sometimes files may not come in for hours So the purpose of the script is to monitor by if no files...
4
by: wahyuhid2384 | last post by:
Hi..all I want to create an software using C# (Visual Studio 2005) My app is expected to monitor the copy-paste file process that is doing by the current logged user. I only want to get 2 main...
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: 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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.