C++ Tutorial #96 : MAX_PATH is here and here to stay! ♥ ALL-CAPS & 8.3 4EVER ♥

preview_player
Показать описание

But don't go thinking FindNextFile (Ex or no) is going to lead you down the garden path ... as you wander aimlessly around your hard drive admiring its deep structure and ... and ... well ... and eventually discovering the fact that that whole interface is still set atop of code written around 1890 or so (or so it seems!).

Thankfully the answers to the most disturbing "path/file" questions were in the affirmative: Basically reparse points are irrelevant and can be ignored.

See what happened was, I decided I might as well just make sure those new file functions I've been adding in work properly, or at least give "reasonable results" for "reasonable situations". But of course one must always run at least one test at the "extremes".

Extreme in this case means a path length equal to MAX_PATH + 1.

Well just *generating* such a situation is a nightmare. You have to write a program to create a directory that you can't get a listing of, but you can write files to. And then with more than 1 reparse point and some 8.3 contractions along the path, the question is ... do all those same functions still work? And if they don't (and they don't ... that is, in the sense of giving the correct answer) can one at least provide YES/NO answers to such pertinent queries such as: "does it exist?" or "is it a file?" and so on.

- A
Рекомендации по теме