By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,576 Members | 1,889 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,576 IT Pros & Developers. It's quick & easy.

Copying files in directory

P: n/a
I want to copy files in directory to another location like
c:\dir1\*.* to f:\dir2
Do I need to copy file by file or can I just copy the whole directory
regards
reidarT
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Reidar,

File by file, when you do not use the process which I advice you not to use.

And for that than the file.move(oldfile,newfile), which is better because
you do not know what other programs are handling the same files and with the
process you cannot catch that.

I hope this helps?

Cor
Nov 21 '05 #2

P: n/a
"ReidarT" <re****@eivon.no> schrieb:
I want to copy files in directory to another location like
c:\dir1\*.* to f:\dir2
Do I need to copy file by file or can I just copy the whole directory

You'll have to loop through the directories and copy file-by-file:

<URL:http://dotnet.mvps.org/dotnet/sample...s/FileSystemEn
umerator.zip>

+

'System.IO.File' + its methods.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #3

P: n/a
>> Do I need to copy file by file or can I just copy the whole directory

I wrote "move" what is wrong.

I have no problem when "you" attents me on that.
As you know I only appriciate that.

Thanks.

:-)

Cor
Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.