Hi NG!
This is my first post to this NG and would like to prefix my question with
the following:
-
I have read the manual, thoroughly. There is absolutely nothing in there
apart from how to call the funtion. -
I have searched the mailing list archives, to no avail.
-
I have grep'ed the source, and have found one use of this function in
opendir()
, this has had limited usefulness. -
I have googled, and this had provided a great big list of manual mirrors
for my future reference ;-) Although I did find a page with a CVS commit on
it that had modified my example code.
I am trying to write a function that will recurse a directory, now the logic
of that is my bat and I am not seeking help with that. But I have tried
using the php_streams API to open the base directory with the following
code:
php_stream *base_dir = NULL;
php_stream_context *context = NULL;
TSRMLS_FETCH();
base_dir = php_stream_opendir (TMPL_G(template_dir),
ENFORCE_SAFE_MODE|REPORT_ERRORS, context);
However, everytime I try to run the module with this last line, I get a
segfault in apache. Now I am not very capable when it comes to Linux C
development and am only vaguely familiar with what gdb does, so I can't
really provide you with any other info than this.
Any help, pointers, etc would be greatly appreciated...
Mikey
php_stream *base_dir = NULL;
php_stream_context *context = NULL;
TSRMLS_FETCH();
base_dir = php_stream_opendir (TMPL_G(template_dir),
ENFORCE_SAFE_MODE|REPORT_ERRORS, context);
That code is (on the surface at least) fine.
However, everytime I try to run the module with this last line, I get a
segfault in apache. Now I am not very capable when it comes to Linux C
development and am only vaguely familiar with what gdb does, so I can't
really provide you with any other info than this.
Here's some instructions on generating a backtrace:
http://bugs.php.net/bugs-generating-backtrace.php
Also, check to make sure that TMPL_G(template_dir) is (A) defined, and (B)
points to a NULL
terminated string in a memory segmet accessable to the
process. Of course, the backtrace will reveal that anyway.
-Sara