www.digitalmars.com         C & C++   DMDScript  

c++ - FTP path lengths

reply "Matthew" <matthew.hat stlsoft.dot.org> writes:
Anyone know if there's a hard limit for FTP url/file paths and, if so, what it
is?

Cheers

Matthew
May 31 2004
next sibling parent "Zz" <Zz Zz.com> writes:
In Internet Explorer it's 2,083 Characters.

Zz

"Matthew" <matthew.hat stlsoft.dot.org> wrote in message
news:c9gbm2$1ovo$1 digitaldaemon.com...
 Anyone know if there's a hard limit for FTP url/file paths and, if so,
what it
 is?

 Cheers

 Matthew
May 31 2004
prev sibling next sibling parent reply Scott Michel <scottm mordred.cs.ucla.edu> writes:
In c++ Matthew <matthew.hat stlsoft.dot.org> wrote:
 Anyone know if there's a hard limit for FTP url/file paths and, if so, what it
 is?
If you're talking about a URL, none that I've been able to find. Same goes for the FTP RFC. So, no, probably not, except if your OS defines an upper limit on path names.
May 31 2004
parent reply "Matthew" <matthew.hat stlsoft.dot.org> writes:
Yeah, I've decided to not count any chickens.

Thanks to you all for your prompt answers.

:)

Matthew

"Scott Michel" <scottm mordred.cs.ucla.edu> wrote in message
news:c9gc5p$1p2d$1 digitaldaemon.com...
 In c++ Matthew <matthew.hat stlsoft.dot.org> wrote:
 Anyone know if there's a hard limit for FTP url/file paths and, if so, what
it
 is?
If you're talking about a URL, none that I've been able to find. Same goes for the FTP RFC. So, no, probably not, except if your OS defines an upper limit on path names.
May 31 2004
parent "Matthew" <matthew.hat stlsoft.dot.org> writes:
Here's an interesting twist. The doc for FtpGetCurrentDirectory() says

    "Using a length of MAX_PATH is sufficient for all paths."



"Matthew" <matthew.hat stlsoft.dot.org> wrote in message
news:c9ghko$20n2$1 digitaldaemon.com...
 Yeah, I've decided to not count any chickens.

 Thanks to you all for your prompt answers.

 :)

 Matthew

 "Scott Michel" <scottm mordred.cs.ucla.edu> wrote in message
 news:c9gc5p$1p2d$1 digitaldaemon.com...
 In c++ Matthew <matthew.hat stlsoft.dot.org> wrote:
 Anyone know if there's a hard limit for FTP url/file paths and, if so, what
it
 is?
If you're talking about a URL, none that I've been able to find. Same goes
for
 the FTP RFC.

 So, no, probably not, except if your OS defines an upper limit on path names.
May 31 2004
prev sibling next sibling parent "Zz" <Zz Zz.com> writes:
Looking at the question again for Internet Explorer its actually a maximum
URL length of 2083 and a maximum path length of 2048.
As far as I know there is no specified limit and some other products have
different length.

Zz

"Matthew" <matthew.hat stlsoft.dot.org> wrote in message
news:c9gbm2$1ovo$1 digitaldaemon.com...
 Anyone know if there's a hard limit for FTP url/file paths and, if so,
what it
 is?

 Cheers

 Matthew
May 31 2004
prev sibling parent reply "Walter" <newshound digitalmars.com> writes:
"Matthew" <matthew.hat stlsoft.dot.org> wrote in message
news:c9gbm2$1ovo$1 digitaldaemon.com...
 Anyone know if there's a hard limit for FTP url/file paths and, if so,
what it
 is?
The hard limit is when your stack buffer overflows and a virus gets written onto it.
Jun 01 2004
next sibling parent "Matthew" <matthew.hat stlsoft.dot.org> writes:
Yes, very good. ;)

In fact, I've fixed up various assumptions of path length in STLSoft and recls,
and there are now the classes basic_file_path_buffer in both WinSTL and UNIXSTL,
which provide the appropriate sized buffers. For WinSTL, if the OS is NT, then
it
provides a buffer of 32001, 9x it provides 261. For UNIXSTL, if PATH_MAX is
defined, then the length is 1 + PATH_MAX, otherwise it calls pathconf().

For InetSTL it's not assuming any length at all for most of the code, although
things that deal with FTP directory lengths do assume _MAX_PATH, since that's
documented in the WinInet API.

"Walter" <newshound digitalmars.com> wrote in message
news:c9ilrl$22iv$1 digitaldaemon.com...
 "Matthew" <matthew.hat stlsoft.dot.org> wrote in message
 news:c9gbm2$1ovo$1 digitaldaemon.com...
 Anyone know if there's a hard limit for FTP url/file paths and, if so,
what it
 is?
The hard limit is when your stack buffer overflows and a virus gets written onto it.
Jun 01 2004
prev sibling parent reply "Matthew" <matthew.hat stlsoft.dot.org> writes:
Yes, very good. ;)

In fact, I've fixed up various assumptions of path length in STLSoft and recls,
and there are now the classes basic_file_path_buffer in both WinSTL and UNIXSTL,
which provide the appropriate sized buffers. For WinSTL, if the OS is NT, then
it
provides a buffer of 32001, 9x it provides 261. For UNIXSTL, if PATH_MAX is
defined, then the length is 1 + PATH_MAX, otherwise it calls pathconf().

For InetSTL it's not assuming any length at all for most of the code, although
things that deal with FTP directory lengths do assume _MAX_PATH, since that's
documented in the WinInet API.

btw, the next version of recls, which I'm working on right now, will allow FTP
searches on Win32. (I'm using ftp.digitaldaemon.com as my test site <g>) I'll
naturally be updating the D mapping.

"Walter" <newshound digitalmars.com> wrote in message
news:c9ilrl$22iv$1 digitaldaemon.com...
 "Matthew" <matthew.hat stlsoft.dot.org> wrote in message
 news:c9gbm2$1ovo$1 digitaldaemon.com...
 Anyone know if there's a hard limit for FTP url/file paths and, if so,
what it
 is?
The hard limit is when your stack buffer overflows and a virus gets written onto it.
Jun 01 2004
parent "Walter" <newshound digitalmars.com> writes:
The best approach is to do one's damdest in writing the code to avoid any
need to even know the maximum path length.

"Matthew" <matthew.hat stlsoft.dot.org> wrote in message
news:c9is50$2bft$1 digitaldaemon.com...
 Yes, very good. ;)

 In fact, I've fixed up various assumptions of path length in STLSoft and
recls,
 and there are now the classes basic_file_path_buffer in both WinSTL and
UNIXSTL,
 which provide the appropriate sized buffers. For WinSTL, if the OS is NT,
then it
 provides a buffer of 32001, 9x it provides 261. For UNIXSTL, if PATH_MAX
is
 defined, then the length is 1 + PATH_MAX, otherwise it calls pathconf().

 For InetSTL it's not assuming any length at all for most of the code,
although
 things that deal with FTP directory lengths do assume _MAX_PATH, since
that's
 documented in the WinInet API.

 btw, the next version of recls, which I'm working on right now, will allow
FTP
 searches on Win32. (I'm using ftp.digitaldaemon.com as my test site <g>)
I'll
 naturally be updating the D mapping.
Jun 01 2004