--- IfTask.cs	23 Aug 2003 13:31:34 -0000	1.20
+++ IfTask.cs	4 Sep 2003 12:50:29 -0000
@@ -125,6 +125,8 @@
         private string _targetName = null;
         private string _primaryFile = null;
         private FileSet _compareFiles = null;
+        private string _fileexists = null;
+        private string _pathexists = null;
 
         #endregion Private Instance Fields
 
@@ -189,11 +191,32 @@
             set { _targetName = SetStringValue(value); }
         }
 
+        /// <summary>
+        /// Used to test whether a file exists.
+        /// </summary>
+        [TaskAttribute("fileexists")]
+        public string FileExists 
+        {
+            get { return _fileexists; }
+            set { _fileexists = SetStringValue(value); }
+        }
+
+        /// <summary>
+        /// Used to test whether a path exists.
+        /// </summary>
+        [TaskAttribute("pathexists")]
+        public string PathExists 
+        {
+            get { return _pathexists; }
+            set { _pathexists = SetStringValue(value); }
+        }
+
         #endregion Public Instance Properties
 
         #region Protected Instance Properties
 
@@ -242,6 +265,26 @@
                     if (!ret) {
                         return false;
                     }
+                }
+
+                // check if file exists
+                if (FileExists != null) 
+                {
+                    FileInfo file = new FileInfo(FileExists);
+                    if (!file.Exists) 
+                    {
+                        ret = false;
+                    } 
+                }
+
+                // check if file exists
+                if (PathExists != null) 
+                {
+                    DirectoryInfo path = new DirectoryInfo(PathExists);
+                    if (!path.Exists) 
+                    {
+                        ret = false;
+                    } 
                 }
 
                 return ret;

