Exemplo n.º 1
0
        static void TestOpenVMSParser()
        {
            string[] sample = new string[] {
                "411_4114.TXT;1             11  21-MAR-2012 15:17 [TBMS,TBMS_BOSS] (RWED,RWED,,RE)",
                "ACT_CC_NAME_4114.TXT;1    30  21-MAR-2012 15:17 [TBMS,TBMS_BOSS] (RWED,RWED,,RE)",
                "ACT_CC_NUM_4114.TXT;1     30  21-MAR-2012 15:17 [TBMS,TBMS_BOSS] (RWED,RWED,,RE)",
                "ACT_CELL_NAME_4114.TXT;1 113  21-MAR-2012 15:17 [TBMS,TBMS_BOSS] (RWED,RWED,,RE)",
                "ACT_CELL_NUM_4114.TXT;1  113  21-MAR-2012 15:17 [TBMS,TBMS_BOSS] (RWED,RWED,,RE)",
                "AGCY_BUDG_4114.TXT;1      63  21-MAR-2012 15:17 [TBMS,TBMS_BOSS] (RWED,RWED,,RE)",
                "CELL_SUMM_4114.TXT;1     125  21-MAR-2012 15:17 [TBMS,TBMS_BOSS] (RWED,RWED,,RE)",
                "CELL_SUMM_CHART_4114.PDF;2 95  21-MAR-2012 10:58 [TBMS,TBMS_BOSS] (RWED,RWED,,RE)",
                "DET_4114.TXT;1          17472  21-MAR-2012 15:17 [TBMS,TBMS_BOSS] (RWED,RWED,,RE)",
                "DET_4114_000.TXT;1        777  21-MAR-2012 15:18 [TBMS,TBMS_BOSS] (RWED,RWED,,RE)",
                "DET_4114_001.TXT;1        254  21-MAR-2012 15:18 [TBMS,TBMS_BOSS] (RWED,RWED,,RE)",
                "DET_4114_003.TXT;1         21  21-MAR-2012 15:18 [TBMS,TBMS_BOSS] (RWED,RWED,,RE)",
                "DET_4114_006.TXT;1         22  21-MAR-2012 15:18 [TBMS,TBMS_BOSS] (RWED,RWED,,RE)",
                "DET_4114_101.TXT;1        431  21-MAR-2012 15:18 [TBMS,TBMS_BOSS] (RWED,RWED,,RE)",
                "DET_4114_121.TXT;1       2459  21-MAR-2012 15:18 [TBMS,TBMS_BOSS] (RWED,RWED,,RE)",
                "DET_4114_124.TXT;1       4610  21-MAR-2012 15:18 [TBMS,TBMS_BOSS] (RWED,RWED,,RE)",
                "DET_4114_200.TXT;1        936  21-MAR-2012 15:18 [TBMS,TBMS_BOSS] (RWED,RWED,,RE)",
                "TEL_4114.TXT;1           1178  21-MAR-2012 15:19 [TBMS,TBMS_BOSS] (RWED,RWED,,RE)"
            };

            foreach (string s in sample)
            {
                FtpListItem item = FtpListItem.Parse("disk$user520:[4114.2012.Jan]", s, 0);

                if (item != null)
                {
                    Console.WriteLine(item.Modified);
                    //Console.WriteLine(item);
                }
            }
        }
Exemplo n.º 2
0
        static void TestIISParser()
        {
            string[] sample = new string[] {
                "03-07-13  10:02AM                  901 File01.xml",
                "03-07-13  10:03AM                  921 File02.xml",
                "03-07-13  10:04AM                  904 File03.xml",
                "03-07-13  10:04AM                  912 File04.xml",
                "03-08-13  11:10AM                  912 File05.xml",
                "03-15-13  02:38PM                  912 File06.xml",
                "03-07-13  10:16AM                  909 File07.xml",
                "03-07-13  10:16AM                  899 File08.xml",
                "03-08-13  10:22AM                  904 File09.xml",
                "03-25-13  07:27AM                  895 File10.xml",
                "03-08-13  10:22AM                 6199 File11.txt",
                "03-25-13  07:22AM                31444 File12.txt",
                "03-25-13  07:24AM                24537 File13.txt"
            };

            foreach (string s in sample)
            {
                FtpListItem item = FtpListItem.Parse("/", s, 0);

                if (item != null)
                {
                    Console.WriteLine(item.Modified);
                    //Console.WriteLine(item);
                }
            }
        }
Exemplo n.º 3
0
        public void Issue549()
        {
            var raw = new List <string>
            {
                @"dr--r--r--   1 root  root    0                  Game",               //unknown ftp server
                @"-rwxrwxrwx   1 root root      13799424 Jul 11 2011 AvatarAssetPack"  //aurora
            };

            FtpListItem.Parser parser = null;

            var buf  = raw[0];
            var item = FtpListItem.Parse("/", buf, FtpCapability.NONE, out parser);

            Assert.IsNotNull(parser);
            Assert.AreEqual(item.Type, FtpFileSystemObjectType.Directory);
            Assert.AreEqual(item.Name, "Game");
            Assert.AreEqual(item.Modified, DateTime.MinValue);
            Assert.AreEqual(item.Size, 0);

            buf  = raw[1];
            item = FtpListItem.Parse("/", buf, FtpCapability.NONE, out parser);
            Assert.IsNotNull(parser);
            Assert.AreEqual(item.Type, FtpFileSystemObjectType.File);
            Assert.AreEqual(item.Name, "AvatarAssetPack");
            Assert.AreEqual(item.Modified, new DateTime(2011, 7, 11));
            Assert.AreEqual(item.Size, 13799424);
        }
Exemplo n.º 4
0
        static void TestUnixListParser()
        {
            string[] sample = new string[] {
                "drwxr-xr-x   7  user1 user1       512 Sep 27  2011 .",
                "drwxr-xr-x  31 user1  user1      1024 Sep 27  2011 ..",
                "lrwxrwxrwx   1 user1  user1      9 Sep 27  2011 data.0000 -> data.6460",
                "drwxr-xr-x  10 user1  user1      512 Jun 29  2012 data.6460",
                "lrwxrwxrwx   1 user1 user1       8 Sep 27  2011 sys.0000 -> sys.6460",
                "drwxr-xr-x 133 user1  user1     4096 Jun 25 16:26 sys.6460"
            };

            foreach (string s in sample)
            {
                FtpListItem item = FtpListItem.Parse("/", s, FtpCapability.NONE);

                if (item != null)
                {
                    Console.WriteLine(item);
                }
            }
        }