[Bf-committers] Long plugin path problem

Robert Wenzlaff bf-committers@blender.org
Sun, 21 Sep 2003 23:43:59 -0400

On Sunday 21 September 2003 06:28 pm, Stephane SOPPERA wrote:

> >_POSIX_PATH_MAX is 256, so there's no reason to make it longer than that.
> On my system (Linux Mandrake), MAX_PATH is 4096. That's NAME_MAX which
> is limited to 255. Why not set the length to the maximum length of the
> system blender is built on? Must this limit be the same for all systems?

It should be set to the smallest of all platforms, otherwise, you get .blend 
files made on one system that are unusable on others.  Rather than canvasing 
all Blenders platforms, I chose a common standard, posix.  We may be able to 
get by with a larger one, but how often is that needed, and because this is 
C, all that memory stays allocated.  

> (actually I still haven't had enough time to see how blender stores
> informations to .blend files and what is stored. Since the absolute path
> does not make sense for a plugin, I'm not sure this path is stored in
> the .blend files. Is it stored?)

Some string is stored, it's not neccesarily an absolute path - It's what you 
type.  Since the .blend file is just a dump of the structs to a file, all 4K 
of each of your file names is in there, even if you don't set a single char.

> >  And
> >it even pads the DNA nicely.
> What does that means?

DNA is how Blender reloads the structs from a file.  Each struct has an ID 
code that determins it's type.  For the structs to load right, the data must 
fall cleanly on 64 bit boundaries so the various compilers don't insert empty 
space into it (because they'd all do it differently). 
You can't always have what you want. Sometimes things don't 
  work as planned.  Things get lost and sometimes can't be 
  found.   Death can occur at any time, without warning.

        Microsoft.  Software for the real world.   
Robert Wenzlaff                 rwenzlaff@soylent-green.com