I have a file path pointing to a text file on disk, I want to write the details of every file within c:\temp\ overwriting any exisiting text.
this should be in the format ( "<fullName> : <name>" ) Each file data should be on a new line and teh files of all sub-directories should be included.
here is what I have done so far
public static void WriteAllFileDataToDisk(string filePath)
{
var myfile = filePath.AsFile();
var listoffiles = "c:\\temp\\".AsDirectory().GetFiles(true);
foreach (var y in listoffiles)
{
myfile.WriteAllText("{0} : {1}".FormatWith(y.AsFile().FullName, y.AsFile().Name));
}
}
it is not working correctly. please let know if you can help.