5

I know that file system access in WinRT is different (read: isolated), but I'm curious if we still have to worry about MAX_PATH, or has that restriction been avoided?

codekaizen
  • 26,990
  • 7
  • 84
  • 140

1 Answers1

5

No, the MAX_PATH restrictions haven't been lifted - if you pass a path longer than MAX_PATH to a windows runtime API which accepts a path, it is still possible it will fail. But MAX_PATH is far less likely to be relevant, since windows runtime APIs typically operate on strings, and not on buffers of characters.

In addition, since metro style apps are typically restricted in the directories that they access, deep paths are less likely to be encountered.

Larry Osterman
  • 16,086
  • 32
  • 60
  • I apprecate the valuable insight, Larry. I understand the question is mostly moot, since the restrictions on metro style apps will prevent many scenarios where it would be a problem. I was rather curious, though, in how much separation, internally, was done from the Win32 APIs where MAX_PATH is defined. – codekaizen Oct 12 '11 at 03:48
  • I don't believe that fixing the MAX_PATH limitation was a goal of the windows runtime. – Larry Osterman Oct 12 '11 at 04:41
  • Of course. However it seems to me to be a reasonable representative of a constant left out of the creation of a new framework if all Win32 dependencies were avoided. I'd be happy to be lectured as to why either 1) this is an unreasonable choice of an indicator to test this hypothesis or 2) this entire hypothesis is misguided; and would be indebted to you in a way which I would probably have to leave the earth still carrying the burden of if you made any effort to do so. – codekaizen Oct 12 '11 at 05:20
  • Who ever said that Win32 dependencies were avoided? Portions of the windows runtime are 100% new, but other portions are written on top of the existing Win32 APIs. – Larry Osterman Oct 12 '11 at 13:14
  • No one, that I know of. But that was just the problem... No one confirmed they weren't avoided, either. I didn't know how to readjust my mental map of the Windows internals dependencies, given WinRT. I figured MAX_PATH would give me insight into those dependencies because I know that it is Win32 specific, though I'm happy to be schooled on this matter as well (for example, where Win32 APIs end and the MSVCRT begins is rather fuzzy to me). – codekaizen Oct 12 '11 at 16:56
  • Don't worry about internal dependencies (seriously). The windows runtime is a new platform for writing applications. Some of it's written on top of existing Win32 APIs, some of it's written entirely from scratch. It's not clear that ANY of the knowledge about quirks in the Win32 API will transfer and I'm certain that Windows Runtime APIs will have quirks of their own (I'm not aware of any API that doesn't have quirks). – Larry Osterman Oct 13 '11 at 05:14
  • @LarryOsterman have to worry about internal dependencies, since limitations are inherited. Still have to worry about max_path with winrt. – Factor Mystic Jul 13 '14 at 23:07