Пример #1
0
        public override void Execute()
        {
            string[] dirNamesArr  = DirFileUtilities.GetDirectoriesNames(PathTracker.GetInstance().ToString());
            string[] fileNamesArr = DirFileUtilities.GetFileNames(PathTracker.GetInstance().ToString());

            MethodsOutput.PrintLocalStringLine("DIRECTORIES");
            if (dirNamesArr.Length > 0)
            {
                MethodsOutput.PrintArray(dirNamesArr);
            }
            else
            {
                MethodsOutput.PrintLocalStringLine("NO_DIRECTORIES");
            }

            MethodsOutput.SkipLine();

            MethodsOutput.PrintLocalStringLine("FILES");
            if (fileNamesArr.Length > 0)
            {
                MethodsOutput.PrintArray(fileNamesArr);
            }
            else
            {
                MethodsOutput.PrintLocalStringLine("NO_FILES");
            }
        }
Пример #2
0
        /// <summary>
        ///     Concatenate files (<paramref name="paths" />) and print them.
        /// </summary>
        /// <param name="paths"> Files' paths. </param>
        public static void PrintConcatFiles(params string[] paths)
        {
            List <string> fileResList = new List <string>();

            foreach (var path in paths)
            {
                fileResList.AddRange(FileReadLines(path, Encoding.UTF8));
            }

            MethodsOutput.PrintArray(fileResList.ToArray());
        }
Пример #3
0
 public override void Execute()
 {
     string[] drives = Directory.GetLogicalDrives();
     MethodsOutput.PrintArray(drives);
 }