From: Andreas K. <andreask@ActiveState.com> - 2003-06-16 15:56:58
|
> It's often a very nasty and subtle problem, because the struct goes > and writes on a little bit of memory somewhere else. In my case, it > happens to be the 'directory configuration' information for a request > struct in apache. > > > Personally I would go for a different solution: Define our own > > portable struct Tcl_Stat or some such instead of using the > > definition of the system. The platform specific parts then have to > > copy from the system to the tcl definition, but the extensions and > > everyone else can rely on our definition to be the same across > > platforms and compilation options. And if we make it opaque, i.e. a > > handle, with acessors we can even change the structure underneath > > without affecting the users. > > There are a few different things I would like to look into: > > 1) Is this an isolated problem, or are there other things like this > that could bite someone linking Tcl against different programs? Defering to others here. I don't know. > 2) Your solution sounds logical. How similar is this to what's > already available from Tcl_FSStat? Tcl_FSStat uses Tcl_Stat, which is just a typedef for struct stat, struct stat64, etc. i.e. an alias for the OS stat buffer type as selected by the configure. -- Andreas Kupries <andreask@ActiveState.com> Developer @ http://www.ActiveState.com Join the community at the 10th Tcl conference http://wiki.tcl.tk/6274 |