using UnityEngine;
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
public class RecursiveFileProcessor
{
public static void Main(string[] args)
{
foreach(string path in args)
{
if(File.Exists(path))
{
// This path is a file
ProcessFile(path);
}
else if(Directory.Exists(path))
{
// This path is a directory
ProcessDirectory(path);
}
else
{
Console.WriteLine("{0} is not a valid file or directory.", path);
}
}
}
// Process all files in the directory passed in, recurse on any directories
// that are found, and process the files they contain.
public static void ProcessDirectory(string targetDirectory)
{
// Process the list of files found in the directory.
string [] fileEntries = Directory.GetFiles(targetDirectory);
foreach(string fileName in fileEntries)
ProcessFile(fileName);
// Recurse into subdirectories of this directory.
string [] subdirectoryEntries = Directory.GetDirectories(targetDirectory);
foreach(string subdirectory in subdirectoryEntries)
ProcessDirectory(subdirectory);
}
// Insert logic for processing found files here.
public static void ProcessFile(string path)
{
Console.WriteLine("Processed file '{0}'.", path);
}
}
wow! Thaanks!
– RafaelMarianoAnd how much do you think he learned by your doing it for him? I am happy to help people. I do that all the time. Helping means leading them through their questions to find their own answers. I don't just write other people's projects for them, or rather, when I do, I charge $70 to $100 an hour. http://www.linkedin.com/in/kesselman If your time and skills aren't worth that much then thats really your business.
– Jeff-Kesselman@Jeff_Kesselman, The world is made of people like you: OWNER OF YOUR OWN KNOWLEDGE. I very much appreciated the curriculum, but change its didactic teaching. She hides her humility. NOTE: Leave this forum if your interest is money!
– Kamuiyshirou@Jeff_Kesselman, I have no intention to offend you. Do not feel offended. I greatly admire all teachers. Just did replicate your answer, but tell that to David Helgason'm very happy for his life. I know your intention was that I hard I tried for my objectives. God bless you!
– Kamuiyshirou