POV-Ray : Newsgroups : povray.animations : Windows shell for DOS CMPEG utility Server Time
28 Jul 2024 20:22:21 EDT (-0400)
  Windows shell for DOS CMPEG utility (Message 21 to 24 of 24)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Jon A  Cruz
Subject: Re: Windows shell for DOS CMPEG utility
Date: 9 Jan 2000 11:57:02
Message: <3878BEC1.A4B6C512@geocities.com>
Sander wrote:

> Isn't there always?
> What do _you_ suggest? Dynamic allocation of space? Or whatever it's called?
>  I am just a layman, don't forget!
> --
> Regards,
> Sander
>
> Nieminen Juha <war### [at] punarastascstutfi> schreef in berichtnieuws
> 387893fe@news.povray.org...
> > Sander <san### [at] stolscom> wrote:
> > : I'll upload the newer version (0.1.1.385). In it I have provided space
> for
> > : longer path names, 256 chars.
> >
> >   Why there should be any limit?
>

On Windows, there's a define in an include file somewhere you should use.
MAX_PATH. It's in stdlib.h and windef.h on my version here. In those it's set
to 260.

Interestingly enough, wininet has a INTERNET_MAX_PATH_LENGTH set to 2048. I
guess all those buffer overruns attacks on MSIE were in part due to MS
programmers not using their own defines.


Oh, and on another side-note, on other OS's I've seen the corresponding #define
limit set to 1024 and 4096.

--
"My new computer's got the clocks, it rocks
But it was obsolete before I opened the box" - W.A.Y.


Post a reply to this message

From: omniVERSE
Subject: Re: Windows shell for DOS CMPEG utility
Date: 9 Jan 2000 16:38:10
Message: <3878ffc2@news.povray.org>
Looks to me (layman of all laymen) that it's trying to do the long filename
shuffle, ie.  C:\Program Files  becomes  C:\Progra~1.
Maybe Win9* accepts only these short forms while moving the paths around.
Something for me to read up about while mindlessly browsing the internat,
yippie!

Bob

"Sander" <san### [at] stolscom> wrote in message news:3878ac1a@news.povray.org...
> Thanks, I'll try and see if I understand that.
> The problem I'm having is -not- the size of the paths it seems now, but to
> get the function
> ===========
> DWORD GetShortPathName(
>     LPCTSTR lpszLongPath, // points to a null-terminated path string
>     LPTSTR lpszShortPath, // points to a buffer to receive the
> null-terminated short form of the path
>     DWORD cchBuffer  // specifies the size of the buffer pointed to by
> lpszShortPath
>    );
> ============
> to operate properly in W95/98 as well as in WNT4.
> --
> Regards,
> Sander
>
>
> Nieminen Juha <war### [at] punarastascstutfi> schreef in berichtnieuws
> 3878aaab@news.povray.org...
> >   I don't know what language you are using, but if it's C++ then using a
> > string class will remove all static limits. You can read _any_ sized
> strings
> > into them.
>
>
>


Post a reply to this message

From: Dick Balaska
Subject: Re: Windows shell for DOS CMPEG utility
Date: 9 Jan 2000 20:09:31
Message: <38793129.4F66DDF9@buckosoft.com>
"Jon A. Cruz" wrote:

> 
> On Windows, there's a define in an include file somewhere you should use.
> MAX_PATH. It's in stdlib.h and windef.h on my version here. In those it's set
> to 260.

Although for new work, you should use the ANSIesque _MAX_PATH . (All system thingys
are prefixed with an underscore to diferentiate from user thingys.)

From the MSDN library:
===================================================================================
Path Field Limits
#include <stdlib.h>

Remarks

These constants define the maximum length for the path and for the individual fields
within the path.

Constant Meaning 
_MAX_DIR Maximum length of directory component 
_MAX_DRIVE Maximum length of drive component 
_MAX_EXT Maximum length of extension component 
_MAX_FNAME Maximum length of filename component 
_MAX_PATH Maximum length of full path 


The sum of the fields should not exceed _MAX_PATH.
===================================================================================

Of course in typical M$ "We interpret the standards" fashion, we end up with
_strnicmp() yet strncmp().


> Interestingly enough, wininet has a INTERNET_MAX_PATH_LENGTH set to 2048. I
> guess all those buffer overruns attacks on MSIE were in part due to MS
> programmers not using their own defines.

Bug wise, it doesn't really matter what define you use if you ignore it yourself.
That is, if you define a 256 byte buffer and then don't care how much you put in...

---
dik


Post a reply to this message

From: Jon A  Cruz
Subject: Re: Windows shell for DOS CMPEG utility
Date: 10 Jan 2000 01:40:37
Message: <38797FC4.5B285779@geocities.com>
Dick Balaska wrote:

> "Jon A. Cruz" wrote:
>
> >
> > On Windows, there's a define in an include file somewhere you should use.
> > MAX_PATH. It's in stdlib.h and windef.h on my version here. In those it's set
> > to 260.
>
> Although for new work, you should use the ANSIesque _MAX_PATH . (All system thingys
> are prefixed with an underscore to diferentiate from user thingys.)

[SNIP]

> Of course in typical M$ "We interpret the standards" fashion, we end up with
> _strnicmp() yet strncmp().

Stay away from the stuff with the leading '_' that Microsoft decided to go with if
possible. Not many
others use it. _MAX_PATH doesn't exist in any header files anywhere on my entire Linux
setup (and I tend
to install all the developer options also). If it compiles without the '_', go for it.
Use "open()" not
"_open()", "O_RDWR" and not "_O_RDWR", etc. (although MAX_PATH might need it)

For cross-platform code for years I've had to remove that leading '_' to get things to
compile on OS/9,
Unix, Linux ...

For defines, on Linux, we have MAX_PATH_LEN, and VC 5.0 has both "_MAX_PATH" and
"MAX_PATH" hanging
around.

w3c-libwww's wwwsys.h has the following code:
/*

ROUGH ESTIMATE OF MAX PATH LENGTH

 */
#ifndef HT_MAX_PATH
#ifdef MAXPATHLEN
#define HT_MAX_PATH MAXPATHLEN
#else
#ifdef PATH_MAX
#define HT_MAX_PATH PATH_MAX
#else
#define HT_MAX_PATH 1024                        /* Any better ideas? */
#endif
#endif
#endif /* HT_MAX_PATH */

--
"My new computer's got the clocks, it rocks
But it was obsolete before I opened the box" - W.A.Y.


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.