Beispiel #1
0
 private void writeToLog(string format, params object[] args)
 {
     if (format.Contains("ERROR"))
     {
         HostSystem.writeToLog("ACF: " + this + " " + format, args);
     }
 }
Beispiel #2
0
        public static string[] GetFiles(string pathname, string ext)
        {
            string exists = ResolveToExistingPath(pathname);

            if (exists != null)
            {
                pathname = exists;
            }
            if (Directory.Exists(pathname))
            {
                return(HostSystem.SortLikeExplorer(Directory.GetFiles(pathname, ext)));
            }
            return(new string[0]);
        }
Beispiel #3
0
        public static String[] GetWildFiles(string pathname, out string dirname, out string filemask)
        {
            if (IsWildPath(pathname))
            {
                if (SplitDirAndFile(pathname, out dirname, out filemask))
                {
                    return(GetFiles(dirname, filemask));
                }
            }
            string exists = ResolveToExistingPath(pathname);

            string[] file;
            if (exists != null)
            {
                pathname = exists;
            }
            if (DirExists(pathname))
            {
                filemask = "*";
                dirname  = ToCanonicalDirectory(pathname);
                string[] files = HostSystem.GetFiles(dirname, filemask);
                if (files.Length == 0)
                {
                    return(files);
                }
                return(files);
            }
            filemask = "";
            dirname  = "";
            while (pathname.Length > 0)
            {
                if (DirExists(pathname))
                {
                    dirname = ToCanonicalDirectory(pathname);
                    string[] files = HostSystem.GetFiles(dirname, filemask);
                    return(files);
                }
                {
                    string lastDir = Path.GetFileName(pathname);
                    filemask = Combine(lastDir, filemask);
                    dirname  = GetBaseDir(pathname);
                }
            }
            return(null);
        }
Beispiel #4
0
        public static String[] GetFiles(string pathname)
        {
            string exists = ResolveToExistingPath(pathname);

            if (exists != null)
            {
                pathname = exists;
            }
            if (DirExists(pathname))
            {
                return(SortLikeExplorer(Directory.GetFiles(pathname)));
            }

            string dirname = GetBaseDir(pathname);

            if (dirname != null && DirExists(dirname))
            {
                string filename = Path.GetFileName(pathname);
                return(HostSystem.GetFiles(dirname, filename));
            }
            return(new string[0]);
        }