#31347 [Com]: is_dir and is_file (incorrectly) return true for any string 255 characters

2005-10-10 Thread nunbot at gmail dot com
 ID:   31347
 Comment by:   nunbot at gmail dot com
 Reported By:  gilad dot buzi at concatel dot com
 Status:   Verified
 Bug Type: Filesystem function related
 Operating System: win32 only
 PHP Version:  5CVS, 4CVS (2005-03-06)
 New Comment:

I've seen this in 5.0.4 build 2600 using win32. Unfortunately the
string length does not seem to matter at all on both is_dir() and
is_file().
~nunbot


Previous Comments:


[2005-02-22 15:52:52] [EMAIL PROTECTED]

Win32 specific bug, due to the stat() function not having handling in
place for filenames 255 chars.



[2005-02-20 16:21:11] smith at backendmedia dot com

You can add file_exists() to the list of functions that have this
error. I tested this with php4-win32-STABLE-200502081330.zip



[2004-12-30 10:43:57] gilad dot buzi at concatel dot com

Description:

is_dir() and is_file() (incorrectly) return true for any string larger
than 255 characters.

I tried this on two different machines, with the out of the box,
precompiled/downloaded Windows version of php 5.0.3.  No changes were
made to the standard php.ini-dist.  No extra extensions were loaded. 
We are using PHP as an Apache2 module (php2apache2.dll).  We also tried
the latest CVS snapshot (5CVS-2004-12-30 (dev)) and got the same
results. 

We tried, and could NOT reproduce this on Linux.  It only failed on
windows platforms.  

Curiously (or maybe not so curious), file_exists() DOES work fine. 

Reproduce code:
---
?
$myfilename=aaaccsaccss;
echo myfilename is: $myfilename;
echo brmyfilename is .strlen($myfilename). characters long;
echo bris_dir: .is_dir($myfilename);
echo brfile_exists: .file_exists($myfilename);
echo bris_file: .is_file($myfilename);

$myfilename=ccsaccss;
echo brbrmyfilename is: $myfilename;
echo brmyfilename is .strlen($myfilename). characters long;
echo bris_dir: .is_dir($myfilename);
echo brfile_exists: .file_exists($myfilename);
echo bris_file: .is_file($myfilename);
?

Expected result:

is_dir() and is_file() should return false if the file or directory
does not exist, regardless of the length of the string they are
passed.



Actual result:
--
Result for above script is:
myfilename is:
aaaccsaccss
myfilename is 255 characters long
is_dir:
file_exists:
is_file:

myfilename is:
ccsaccss
myfilename is 256 characters long
is_dir: 1
file_exists: 1
is_file:





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


#31347 [Com]: is_dir and is_file (incorrectly) return true for any string 255 characters

2005-02-20 Thread smith at backendmedia dot com
 ID:   31347
 Comment by:   smith at backendmedia dot com
 Reported By:  gilad dot buzi at concatel dot com
 Status:   Open
 Bug Type: *Directory/Filesystem functions
 Operating System: Windows (2000/XP)
 PHP Version:  5.0.3
 New Comment:

You can add file_exists() to the list of functions that have this
error. I tested this with php4-win32-STABLE-200502081330.zip


Previous Comments:


[2004-12-30 10:43:57] gilad dot buzi at concatel dot com

Description:

is_dir() and is_file() (incorrectly) return true for any string larger
than 255 characters.

I tried this on two different machines, with the out of the box,
precompiled/downloaded Windows version of php 5.0.3.  No changes were
made to the standard php.ini-dist.  No extra extensions were loaded. 
We are using PHP as an Apache2 module (php2apache2.dll).  We also tried
the latest CVS snapshot (5CVS-2004-12-30 (dev)) and got the same
results. 

We tried, and could NOT reproduce this on Linux.  It only failed on
windows platforms.  

Curiously (or maybe not so curious), file_exists() DOES work fine. 

Reproduce code:
---
?
$myfilename=aaaccsaccss;
echo myfilename is: $myfilename;
echo brmyfilename is .strlen($myfilename). characters long;
echo bris_dir: .is_dir($myfilename);
echo brfile_exists: .file_exists($myfilename);
echo bris_file: .is_file($myfilename);

$myfilename=ccsaccss;
echo brbrmyfilename is: $myfilename;
echo brmyfilename is .strlen($myfilename). characters long;
echo bris_dir: .is_dir($myfilename);
echo brfile_exists: .file_exists($myfilename);
echo bris_file: .is_file($myfilename);
?

Expected result:

is_dir() and is_file() should return false if the file or directory
does not exist, regardless of the length of the string they are
passed.



Actual result:
--
Result for above script is:
myfilename is:
aaaccsaccss
myfilename is 255 characters long
is_dir:
file_exists:
is_file:

myfilename is:
ccsaccss
myfilename is 256 characters long
is_dir: 1
file_exists: 1
is_file:





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