I have a local and remote directory structure. I need to copy all of the
folders and files for a given remote parent to the local parent. I am
getting all twisted up in my logic though. Here is what I have so far. Can
someone explain to me where I would put a recursive call? I need every file
and every directory.
public static void OnTimer(Object source, ElapsedEventArgs e) {
directories dirs = constants.getInstance().dirs;
foreach(directory d in dirs){
string watchPath = null;
string copyToPath = null;
if(d.Direction.Equals("rl")){
watchPath = d.RemotePath;
copyToPath = d.LocalPath;
}
else if(d.Direction.Equals("lr")){
watchPath = d.LocalPath;
copyToPath = d.RemotePath;
}
d.IsRunning = true;
d.FileEvent = path;
DirectoryInfo di = new DirectoryInfo(watchPath);
DirectoryInfo[] dirs = di.GetDirectories();
FileInfo[] fis = di.GetFiles();
foreach(DirectoryInfo diNext in dirs){
foreach(FileInfo fiNext in fis){
}
}
}
}
Travis D. Falls |Consultant, RAFT.Net IT | 860.547.4070 |
<mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
*************************************************************************
PRIVILEGED AND CONFIDENTIAL: This communication, including attachments, is
for the exclusive use of addressee and may contain proprietary,
confidential and/or privileged information. If you are not the intended
recipient, any use, copying, disclosure, dissemination or distribution is
strictly prohibited. If you are not the intended recipient, please notify
the sender immediately by return e-mail, delete this communication and
destroy all copies.
*************************************************************************
[Non-text portions of this message have been removed]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/