473,396 Members | 1,886 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,396 software developers and data experts.

Automated File Copying

HI All,

I am trying to make a small program that will copy the contents of one
folder into another folder automatically. This is for backup and i
want to just be able to run the program and have all the files be
copied. Didn't know if there was some API or some easy lines of code
that anyone knew of.
Thanks in advance
Reply Reply with quote

Aug 21 '06 #1
6 1135
<an***********@gmail.comschrieb:
I am trying to make a small program that will copy the contents of one
folder into another folder automatically. This is for backup and i
want to just be able to run the program and have all the files be
copied. Didn't know if there was some API or some easy lines of code
that anyone knew of.
Check out the classes in the 'System.IO' namespace, namely 'Directory' and
'File'. In addition you may want to take a look at
'My.Computer.FileSystem.CopyDirectory'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Aug 21 '06 #2
adm
an***********@gmail.com wrote:
HI All,

I am trying to make a small program that will copy the contents of one
folder into another folder automatically. This is for backup and i
want to just be able to run the program and have all the files be
copied.
since you mentioned "backup" and "automatically," i'm guessing you
might want this to backup a file whenever something is added to the
folder, or something like that. if that's the case, check out the stuff
mentioned by HW above, but more specifically, see FileSystemWatcher,
which is in System.IO.

Tutorial:
http://www.codeproject.com/dotnet/folderwatcher.asp

Aug 21 '06 #3
I wrote a program like this, except that it doesn't have the FileWatcher
stuff in it. You can have it if you want.

Steve

<an***********@gmail.comwrote in message
news:11*********************@i42g2000cwa.googlegro ups.com...
HI All,

I am trying to make a small program that will copy the contents of one
folder into another folder automatically. This is for backup and i
want to just be able to run the program and have all the files be
copied. Didn't know if there was some API or some easy lines of code
that anyone knew of.
Thanks in advance
Reply Reply with quote

Aug 21 '06 #4
Steve,

That would be great if you would send that to me. I just want to see
how you coded it.

Many thanks,
Andrew
Steve Long wrote:
I wrote a program like this, except that it doesn't have the FileWatcher
stuff in it. You can have it if you want.

Steve

<an***********@gmail.comwrote in message
news:11*********************@i42g2000cwa.googlegro ups.com...
HI All,

I am trying to make a small program that will copy the contents of one
folder into another folder automatically. This is for backup and i
want to just be able to run the program and have all the files be
copied. Didn't know if there was some API or some easy lines of code
that anyone knew of.
Thanks in advance
Reply Reply with quote
Aug 28 '06 #5
Steve,

That would be great if you would send that to me. I just want to see
how you coded it.

Many thanks,
Andrew
Steve Long wrote:
I wrote a program like this, except that it doesn't have the FileWatcher
stuff in it. You can have it if you want.

Steve

<an***********@gmail.comwrote in message
news:11*********************@i42g2000cwa.googlegro ups.com...
HI All,

I am trying to make a small program that will copy the contents of one
folder into another folder automatically. This is for backup and i
want to just be able to run the program and have all the files be
copied. Didn't know if there was some API or some easy lines of code
that anyone knew of.
Thanks in advance
Reply Reply with quote
Aug 28 '06 #6
Steve,

That would be great if you would send that to me. I just want to see
how you coded it.

Many thanks,
Andrew
Steve Long wrote:
I wrote a program like this, except that it doesn't have the FileWatcher
stuff in it. You can have it if you want.

Steve

<an***********@gmail.comwrote in message
news:11*********************@i42g2000cwa.googlegro ups.com...
HI All,

I am trying to make a small program that will copy the contents of one
folder into another folder automatically. This is for backup and i
want to just be able to run the program and have all the files be
copied. Didn't know if there was some API or some easy lines of code
that anyone knew of.
Thanks in advance
Reply Reply with quote
Aug 28 '06 #7

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

Similar topics

6
by: Luc Saffre | last post by:
Hello, I had a strange problem when freezing (using either py2exe or McMillan installer) a script that imports reportlab (which imports PIL (which imports FixTk))). - Python 2.3.3c (also with...
5
by: Thomas Lotze | last post by:
Hi, another question: What's the most efficient way of copying data between two file-like objects? f1.write(f2.read()) doesn't seem to me as efficient as it might be, as a string containing...
3
by: Chris | last post by:
I've been researching this on and off for weeks, and haven't come up with anything useful yet. If anyone knows how to do this, please let me know. From a Java applet running in IE 6.0 using the...
5
by: Salad | last post by:
I have a textbox for storing the URL to a web page. I figured the person could simply copy the URL from IE and paste it into the text box. The client would like to have a more automated process. ...
6
by: brettev | last post by:
World, I work at a university where the professors have a system to input grades for assignments and calculate final grades, which is output to an excel file. they are then required to get on a...
3
by: aj | last post by:
DB2 LUW 8.2 FP14 Red Hat AS 2.1 I am using a response file w/ db2setup to install DB2. I then want to install the latest fixpak in the same automated way. Is there any way to use a response...
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...
9
by: tdahsu | last post by:
All, I have the following code: for fileTarget in dircache.listdir("directory"): (dirName, fileName) = os.path.split(fileTarget) f = open(fileTarget).readlines() copying = False for i in...
2
by: thesti | last post by:
hello, how to programmatically from VB .net / php. to import data from an EXCEL file? is there's no programmatic way, how to automated the process. as i search, the process is: Simply...
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:
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...
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...
0
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...

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.