473,786 Members | 2,426 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Monitoring and copying files

12 New Member
HI

I am running Active Perl on a Windows XP machine.

I am hoping to get some advise on a strategy to monitor and copy files that are arriving in a directory and need to be copied to a second location. Files will arrive at the rate of one every 2 to 4 seconds into a directory immediately below the parent. The number of files written to each directory will vary and the number of directories written will also vary (typically the number of files will be < 5,000 and the number of directories < 50). All files will be written to a directory before the next directory is created. I do not want to wait until all the files arrive before copying them. Ideally I need to monitor the parent directory for new files and directories and copy them as they arrive.

I am thinking of using File::Find to check for both directories/files as the files are arriving. I think that this will create a lot of overhead especially as the number of directories/files increase and I have to check after each file - assuming that the copy can keep up with the arrivals.

I have no source code as I am looking for general advice.

Any suggestions on a more efficient approach?
Feb 1 '07 #1
2 2679
KevinADC
4,059 Recognized Expert Specialist
maybe you should look into setting up a "task" and using a batch file instead of trying to write this in perl.

You could maybe use the File::Path module instead of File::Find to move a tree to another directory.

http://perldoc.perl.org/File/Path.html
Feb 1 '07 #2
Alan Bak
12 New Member
Thanks for the suggestions. I will give them a try!

Cheers
Feb 2 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
3656
by: Robert Tarantino | last post by:
Hello, I am trying to find a way to create a scheduled task or service that will copy my local profile folders under "Documents and settings" to a network drive. This would allow me to restore my settings if my profile became tampered with or corrupt. Is there any sample code available out there? -Robert
0
1557
by: Dan | last post by:
We debug a VB.Net App that uses compact framework to a DAP Windows CE.Net device. When I debug I would like to only have the EXE copied down. Right now it copies any referrences as well and checks the .NET CF version. The first message I receive is: Files in the package 'netcf.all.wce4.armv4.cab' are more recent on the device than on the development computer. Consider upgrading to the latest version. Files affected are:
2
1570
by: rakesh_nits | last post by:
Hi All, I want to watch all fixed drives on a computer.Is there any reliable way to do that.I am watching for create , delete , change , rename events for all files and folders.I am using filesystemwatcher but its not very reliable at all especially for high trafiic activity.I am using empty string for the filter property.I have changed internalbuffersize to 32 KB.I don't want to miss any event , if any event fires two or three times that...
3
6623
by: Curtis Kam | last post by:
Hi, How can I monitor the file size of a file which is still copying? If I've used FileInfo.Length, it'll return the final file size, not the intermediate one. Thanks. Regards, Curtis Kam
0
2095
by: Jeff Reed | last post by:
I am experiencing the the problem outlined the below. Unfortunately, I am using WinXP and I not sure if I can apply the solution due to lack of security control Any feed back would be apreciated http://support.microsoft.com/default.aspx?scid=kb;EN-US;31795 FIX: "Failed to Start Monitoring Directory Changes" Error Message When You Browse to an ASP.NET Pag View products that this article applies to This article was previously...
9
3215
by: Tim D | last post by:
Hi, I originally posted this as a reply to a rather old thread in dotnet.framework.general and didn't get any response. I thought it might be more relevant here; anyone got any ideas? My questions are below... "David Good" wrote: > We have a network running both Win2k and Win2k3 webservers and our web sites > reside on a UNC network share that happens to be a Network Appliance NAS.
4
1557
by: Bob | last post by:
I've got dot net Winform apps that are running in a backroom server with no user interaction. They are supposed to run unattended 24 7 365. They are IVR apps taking orders via telephony. Problem is nobody is looking at them to know if they are OK. They have err trapping built in and there's logging and tracing to log files, but nobody there looks at that. What I need is to find a way to advise one or more managers immediately when an app is...
1
1821
by: Fredrik Johansson | last post by:
Hello, I have built a .NET remoting solution (SingleCall) that writes a file to disk, then waits for a second file in a specified folder (using the FileSystemWatcher.WaitForChanged method). When the component is called by two peers at the same time, two FileSystemWatchers are created (one for each peer). They are both monitoring the same path (but for different files - using different filters). The following code illustrates the...
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
9647
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
9496
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
10363
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...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8989
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
7512
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
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3669
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
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.