problem with fopen
| From: | Animesh Bansriyar | Date: | Fri, 07 May 2004 05:36:42 +0000 |
| Subject: | problem with fopen | ||
| Groups: | php.pecl.dev | ||
| Request: | Send a blank email to pecl-dev+get-616@lists.php.net to get a copy of this message | ||
Hello All,
I am writing a custom PHP extension on Debian GNU/Linux with
Apache2.0.46/PHP-5.0.0RC1 wherein I need to open a file, write to it and
save to disk. I am able to open the file using VCWD_FOPEN, but when I
try to close the file handle, PHP/Apache crashed with "The document
contains no data" error on the browser and segfaults when I run it from
the command line. The sample code is
FILE *infile;
char *dir = "/tmp/neo";
char *file = "/tmp/neo/tmp_file1";
infile = VCWD_FOPEN(file,"wb");
fwrite(inbuf, sizeofinput, 1, infile);
fclose(infile);
I need to use fopen, fwrite while opening a file, writing to it and
saving it. If you can show me some pointers/sample code or some
suggesstions on this, I would be so very thankful. I tried reviewing
some code on the standard PHP extensions but by the end of it I got very
confused.
Thanks in advance,
Regards,
Animesh
--
Animesh Bansriyar <animesh@neolinuxsolutions.com>
http://neolinuxsolutions.com, +91-651-3112497, 3122401.
Linux Intranet/Internet Servers, Specialised E-mail Setups,
Enterprise Database and Directory Services, Linux Application
Development and Commercial Support for Free/OpenSource Software