What is Path max length

I know that it sounds stupid but I am not sure if I am right.
I think that the max path length is 255 bytes. Is it true really ?
Thanks
Jack


Get Your Private, Free Email at http://www.hotmail.com

> Subject: What is Path max length

From: “Jack Brown”
>
>I know that it sounds stupid but I am not sure if I am right.
>I think that the max path length is 255 bytes. Is it true really ?

NTFS and FAT have documented maximum “per element” limitations of about 255
or 256 (the documentation is inconsistent). FindFirstFileW can only return
individual elements with up to 260 chars including the terminal nul. The
full path limit for many Win32 “W” functions, with all “elements”
concatenated with intervening slashes, is documented at being around 32k,
which coincidentally is what fits in a UNICODE_STRING.

Most code cannot deal with paths longer than 260 chars, what windows.h
#defines MAX_PATH to be, but such code is buggy; it is unclear if MAX_PATH
is supposed to include the terminal nul, so some people add one to it in
many places. I’m unsure what the chances are of ever fixing any fraction of
this code, is it So widespread.

You can create arbitrarily long paths by renaming.
mkdir \a\b\c\d\e\f\g.…
cd \a\b\c\d\e\f
ren g gabcdefghijklmnopqrstuvwxyz
cd …
ren f fabcdefghijklmnopqrstuvwxyz
etc.

You can even do this on Windows 95, which doesn’t claim to support paths
longer than MAX_PATH. The implication is that on disk, the limits are
imposed only by disk space, that however deep you can create directories,
you can create paths ~255 * depth long.

- Jay

With CreateFileW you can create files with up to 32000 bytes in
their names on NTFS partition.

Regards, Dennis

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Jay Krell
Sent: Sunday, April 16, 2000 9:03 AM
To: File Systems Developers
Cc: xxxxx@hotmail.com
Subject: [ntfsd] Re: What is Path max length

> Subject: What is Path max length
> From: “Jack Brown”
> >
> >I know that it sounds stupid but I am not sure if I am right.
> >I think that the max path length is 255 bytes. Is it true really ?
>
> NTFS and FAT have documented maximum “per element” limitations of
> about 255
> or 256 (the documentation is inconsistent). FindFirstFileW can only return
> individual elements with up to 260 chars including the terminal nul. The
> full path limit for many Win32 “W” functions, with all “elements”
> concatenated with intervening slashes, is documented at being around 32k,
> which coincidentally is what fits in a UNICODE_STRING.
>
> Most code cannot deal with paths longer than 260 chars, what windows.h
> #defines MAX_PATH to be, but such code is buggy; it is unclear if MAX_PATH
> is supposed to include the terminal nul, so some people add one to it in
> many places. I’m unsure what the chances are of ever fixing any
> fraction of
> this code, is it So widespread.
>
> You can create arbitrarily long paths by renaming.
> mkdir \a\b\c\d\e\f\g.…
> cd \a\b\c\d\e\f
> ren g gabcdefghijklmnopqrstuvwxyz
> cd …
> ren f fabcdefghijklmnopqrstuvwxyz
> etc.
>
> You can even do this on Windows 95, which doesn’t claim to support paths
> longer than MAX_PATH. The implication is that on disk, the limits are
> imposed only by disk space, that however deep you can create directories,
> you can create paths ~255 * depth long.
>
> - Jay
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@yahoo.com
> To unsubscribe send a blank email to $subst(‘Email.Unsub’)
>

__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

MAX_PATH = 260. This supports 256 chars of directory and filenames,
plus drive-letter, colon, backslash and a trailing backslash.

NT unicode APIs can accept 32k-char paths if they follow a certain
format (have \?\ as a prefix). This “tells the function to turn off
path parsing,” whatever that means. I’ve never tried it.


Dave Cox
Hewlett-Packard Co.
HPSO/SSMO (Santa Barbara)
https://ecardfile.com/id/Dave+Cox

-----Original Message-----
From: Jack Brown [mailto:xxxxx@hotmail.com]
Sent: Saturday, April 15, 2000 4:19 AM
To: File Systems Developers
Subject: [ntfsd] What is Path max length

I know that it sounds stupid but I am not sure if I am right.
I think that the max path length is 255 bytes. Is it true really ?
Thanks
Jack


Get Your Private, Free Email at http://www.hotmail.com


You are currently subscribed to ntfsd as: david_cox2@hp.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)