Charles,

2 questions--

1) What OS are you using?
2) Does the file include PHP code? Otherwise, can you keep its contents
in a string and simply output that string? If it contains PHP code, are
you sure that there aren't any errors in the PHP code?

Ok, so it was a bit more than 2 questions :-)


Marco
-- 
------------
php|architect - The magazine for PHP Professionals
The first monthly worldwide  magazine dedicated to PHP programmer

Come visit us at http://www.phparch.com!

--- Begin Message ---
Charles Wiltgen wrote...

> I'm having file locking problems.
> 
> I'm using fopen() to write a file via FTP.  At the end, I'm doing...
> 
>   fflush($fp);
>   fclose($fp);
> 
> ...and then I include it immediately after.  But many times I only get part
> of what I wrote to the file, which suggests that it wasn't really flushed
> and closed properly.

BTW, when I only get part of the file in the browser, I open it with Pico
and it's all there.  So I know that $stuff = ob_end_clean() is working, and
that $stuff is being written to the fopen(ftp://...) pointer correctly.

I suspect that PHP is including before the file is closed, but not returning
an error.  I haven't found any other mechanisms in PHP that would allow me
to verify that the file is really, really, really closed after using
fflush() and fclose() on an fopen("ftp://...";).  Any ideas?

-- Charles Wiltgen


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to