|
|
|
|
|
|
| |
| |
|
|
From: Nieminen Juha
Subject: Re: Windows shell for DOS CMPEG utility
Date: 9 Jan 2000 10:35:07
Message: <3878aaab@news.povray.org>
|
|
|
| |
| |
|
|
Sander <san### [at] stolscom> 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!
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.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Nieminen Juha wrote:
>
> Sander <san### [at] stolscom> 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!
>
> 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.
Even while passing a string from a Windows GUI app to a dos
command line utility ? I would think that the limiting factor
here would be the dos app.
--
Ken Tyler - 1300+ Povray, Graphics, 3D Rendering, and Raytracing Links:
http://home.pacbell.net/tylereng/index.html http://www.povray.org/links/
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
>
It seems like an 'academic' thing to me.
If the program works, with 256 char strings I think it'd be just fine in
most cases. Going beyond that might be interesting but is it really
relevant. How about POV-Rays output of animation frames? It's still
limited to 8 characters for the file names. It seems to me that that is
more a topic to worry about.
Besides that the maximum length of strings or paths is also depending on
platform as far as I know.
Remco
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
That's what I originally thought. CMPEG only accepts 8.3 filenames, and I
have been busy a helluva time to get my "front end" to do just that. Works
fine with WNT4 but not with W9*, it appears..
Looking into it now...
--
Regards,
Sander
Ken <tyl### [at] pacbellnet> schreef in berichtnieuws
3878AA28.1EB08D96@pacbell.net...
> Even while passing a string from a Windows GUI app to a dos
> command line utility ? I would think that the limiting factor
> here would be the dos app.
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Remco de Korte wrote:
>
> Besides that the maximum length of strings or paths is also depending
> on
> platform as far as I know.
Which of course is irrelevant here since we're talking about a Windows
shell 8)
Remco
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
"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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |