Index: FileFunctions.cs
===================================================================
RCS file: /cvsroot/nant/nant/src/NAnt.Core/Functions/FileFunctions.cs,v
retrieving revision 1.6
diff -u -r1.6 FileFunctions.cs
--- FileFunctions.cs	31 Dec 2003 12:48:22 -0000	1.6
+++ FileFunctions.cs	27 Feb 2004 19:03:20 -0000
@@ -100,14 +100,31 @@
         /// <summary>
         /// Determines whether the specified file exists.
         /// </summary>
-        /// <param name="file">The file to check.</param>
+        /// <param name="file">The file to check. </param>
         /// <returns>
         /// <see langword="true" /> if <paramref name="file" /> refers to an 
         /// existing file; otherwise, <see langword="false" />.
         /// </returns>
+        /// <remarks>
+        /// The file name may contain wildcard characters (*,?). In this the function 
+        /// returns <see langword="true" /> if there exists at least one file matching
+        /// the specified pattern.
+        /// </remarks>
         [Function("exists")]
         public bool Exists(string file) {
-            return File.Exists(Project.GetFullPath(file));
+            if (file.IndexOf("*") != -1 || file.IndexOf("?") != -1) {
+                // complex case - use DirectoryScanner to find a list of matching files
+                DirectoryScanner scanner = new DirectoryScanner();
+                scanner.BaseDirectory = new DirectoryInfo(Project.BaseDirectory);
+                scanner.Includes.Add(file);
+
+                if (scanner.FileNames.Count > 0)
+                    return true;
+                else
+                    return false;
+            } else {
+                return File.Exists(Project.GetFullPath(file));
+            }
         }
 
         /// <summary>
