Check for presence of directory
Modified: trunk/cis/ReactOS.CustomRevisionAction/FtpClient.cs
Modified: trunk/cis/ReactOS.CustomRevisionAction/Main.cs

Modified: trunk/cis/ReactOS.CustomRevisionAction/FtpClient.cs
--- trunk/cis/ReactOS.CustomRevisionAction/FtpClient.cs	2005-11-24 13:33:37 UTC (rev 19526)
+++ trunk/cis/ReactOS.CustomRevisionAction/FtpClient.cs	2005-11-24 13:57:25 UTC (rev 19527)
@@ -354,7 +354,21 @@
 
 			return msg;
 		}
-		
+
+		public bool DirectoryExists(string directory)
+		{
+			try
+			{
+				ChangeDir(directory);
+				ChangeDir("..");
+				return true;
+			}
+			catch (FtpException)
+			{
+				return false;
+			}
+		}
+	
 		/// <summary>
 		/// Return the size of a file.
 		/// </summary>

Modified: trunk/cis/ReactOS.CustomRevisionAction/Main.cs
--- trunk/cis/ReactOS.CustomRevisionAction/Main.cs	2005-11-24 13:33:37 UTC (rev 19526)
+++ trunk/cis/ReactOS.CustomRevisionAction/Main.cs	2005-11-24 13:57:25 UTC (rev 19527)
@@ -193,7 +193,7 @@
 			if (directory != "")
 				ftpClient.ChangeDir(directory);
 			/* Create destination directory if it does not already exist */
-			if (ftpClient.GetFileList(branch).Length < 1)
+			if (!ftpClient.DirectoryExists(branch))
 				ftpClient.MakeDir(branch);
 			ftpClient.ChangeDir(branch);
 			ftpClient.Upload(sourceFilename);