Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MAX_PATH in WinRT

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?

like image 838
codekaizen Avatar asked Oct 11 '11 16:10

codekaizen


People also ask

What is MAX_PATH?

In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, name components separated by backslashes, and a terminating null character.

What is the maximum character length of a path folders and filenames?

Microsoft Windows has a MAX_PATH limit of ~256 characters. If the length of the path and filename combined exceed ~256 characters you will be able to see the path/files via the Windows Explorer, but may not be able to delete/move/rename these paths/files.


1 Answers

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.

like image 156
ReinstateMonica Larry Osterman Avatar answered Oct 11 '22 18:10

ReinstateMonica Larry Osterman