Example #1
0
 public static void Main(string[] args)
 {
     Loop.Default.Run(async delegate {
         try {
             await UVDirectoryAsync.Create("testing");
             await UVDirectoryAsync.Rename("testing", "testing123");
             var dirs = await UVDirectoryAsync.Read("./");
             Console.WriteLine("{0} files totally", dirs.Length);
             Console.WriteLine();
             foreach (var dir in dirs)
             {
                 Console.WriteLine(dir);
             }
             await UVDirectoryAsync.Delete("testing123");
         } catch (Exception e) {
             Console.WriteLine(e);
         }
     });
 }
Example #2
0
    public static void Main(string[] args)
    {
        Loop.Default.Run(async delegate {
            try {
                await UVDirectoryAsync.Create("testing");
                await UVDirectoryAsync.Rename("testing", "testing123");
                var files = await UVDirectoryAsync.Read("./");
                Console.WriteLine("{0} files totally", files.Length);
                Console.WriteLine();

                // first order by name, then by type
                foreach (var file in files.OrderBy((file) => file.Name).OrderBy((file) => file.Type))
                {
                    Console.ForegroundColor = GetColor(file.Type);
                    Console.WriteLine(file.Name);
                }

                await UVDirectoryAsync.Delete("testing123");
            } catch (Exception e) {
                Console.WriteLine(e);
            }
        });
    }