i have the following code:
public static void Serialize()
{
List<string> dirs = FileHelper.GetFilesRecursive(fileDirectoryPath);
List<string> dirFiles = new List<string>();
foreach (string p in dirs)
{
string path = p;
string lastAccessTime = File.GetLastAccessTime(path).ToString();
bool DirFile = File.Exists(path);
FileInfo fInf = new FileInfo(path);
long lengthInk = fInf.Length / 1024;
DateTime lastWriteTime = File.GetLastWriteTime(p);
dirFiles.Add(p + "|" + lastAccessTime.ToString() + "|" + DirFile.ToString() + "|" + lastWriteTime.ToString() + "|" + lengthInk.ToString() + " kb");
}
I keep hitting a PathTooLongException error with the following line:
string lastAccessTime = File.GetLastAccessTime(path).ToString();
The application drills into a drive and finds all files/folders w/in the drive. I cannot change this path but since it is above 260 characters...how to work around this?