Example #1
0
        private static object RunFindAndReturnExitCode(FindOptions opts)
        {
            try
            {
                Console.WriteLine("FindDirectories(" + opts.Directory + ", " + opts.Mask + ", " + opts.IP + ")");

                IEnumerable <SimpleFileInfo> dirs = USBLAN.FindDirectories(opts.Directory, opts.Mask, opts.IP);
                foreach (SimpleFileInfo d in dirs)
                {
                    Console.WriteLine("d " + d.Name);
                }

                Console.WriteLine("FindFiles(" + opts.Directory + ", " + opts.Mask + ", " + opts.IP + ")");

                IEnumerable <SimpleFileInfo> files = USBLAN.FindFiles(opts.Directory, opts.Mask, opts.IP);
                foreach (SimpleFileInfo f in files)
                {
                    Console.WriteLine("f " + f.Name);
                }
            }
            catch (Exception e)
            {
                PrintException(e);
                return(1);
            }

            Console.WriteLine("find complete.");
            return(0);
        }
Example #2
0
        private static void TestFindDirectories()
        {
            IEnumerable <SimpleFileInfo> dirs = USBLAN.FindDirectories("/Windows/", "*ro*");

            if (dirs != null)
            {
                Console.WriteLine("Dirs: ");
                int count = 0;
                foreach (var dir in dirs)
                {
                    Console.WriteLine(++count + ") " + dir.Name);
                }
            }
            else
            {
                Console.WriteLine("returned null");
            }
        }