i have the following code:
public static void Serialize()
{
List dirs = FileHelper.GetFilesRecursive(fileDirectoryPath);
The GetLastAccessTime()
call, with a full path can exceed the internal limit (which is OS-version specific, but typically 260 characters) on the maximum length for a fully qualified file path.
One way to avoid this, is to use Directory.SetCurrentDirectory() to change the current system directory and then call GetLastAccessTime()
with only a relative path. Just make sure you change your current directory back to what you started from to avoid unexpected issues.