From:             trutas dot ctx at gmail dot com
Operating system: Windows Server 2003 x64 IIS6.0
PHP version:      5.3.0
PHP Bug Type:     Filesystem function related
Bug description:  is_readable() and filezise() do not return correctly

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 bug report at http://bugs.php.net/?id=48959&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=48959&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=48959&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=48959&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=48959&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=48959&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=48959&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=48959&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=48959&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=48959&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=48959&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=48959&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=48959&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=48959&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=48959&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=48959&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=48959&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=48959&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=48959&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=48959&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=48959&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=48959&r=mysqlcfg

Reply via email to