ID:               48959
 Updated by:       paj...@php.net
 Reported By:      trutas dot ctx at gmail dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         Filesystem function related
 Operating System: win32 - Windows Server 2003 x64
 PHP Version:      5.3.0
-Assigned To:      
+Assigned To:      pajoye
 New Comment:

Cannot reproduce on 2k8, vista and win7. Pls note that I replaced the
my_file_... with the normal file_get_contents function.

Can you paste a working script pls?


Previous Comments:
------------------------------------------------------------------------

[2009-07-17 15:08:28] trutas dot ctx at gmail dot com

Just tested - file_exists() returns false incorrectly too.

I´ve worked around it all with checking for fopen($file, 'r') and
forcing file_get_contents() - it works, file exists, is readable and
returns the content.

------------------------------------------------------------------------

[2009-07-17 12:10:10] trutas dot ctx at gmail dot com

Description:
------------
is_readable() returns false for temporary file (just created)
"C:\WINDOWS\Temp\dom373.tmp" and filezise() fails too.

fopen() and get_file_contents() both work for the same file.

as a workaround i'm using fopen() instead of is_readable() and 
fseek($fopen_instance, 0, SEEK_END); instead of filesize()

Reproduce code:
---------------
//temporary location
$resolved_url = tempnam(DOMPDF_TEMP_DIR, "dompdf_img_");
//get source
$image=my_file_get_contents("http://9tree.net/favicon.ico";);
//save it
file_put_contents($resolved_url, $image);

//tests
if(is_readable($resolved_url)) print "file readable, ";
if(filesize($resolved_url)) print "filezise found.\n";

die("all done.");

Expected result:
----------------
file readable, filezise found.
all done.

Actual result:
--------------
all done.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=48959&edit=1

Reply via email to