How to check for paths that are too long?

.net, c#

Solution

It seems that the answer is given by Tim Schmelter here : In ILSpy it seems that `GetFullPath` uses `MaxDirectoryLength`(255) whereas `CreateDirectory` uses 248.

EDIT: It was made into an answer.

Problem

I want to check for paths that are too long once for a whole list and only then copy/create them... So I thought this would be good: ``` try { FileInfo file = new FileInfo(path); string temp = file.FullName; } catch { } ``` however, no exception is thrown then. I rather not hardcode the limits because they might change, and I might be missing a limit... So how can I check for long paths?

Original source