Bug #53214 [Fbk->Opn]: is_readable() returns false on readable files on windows network drive to linux

From: Date: Sun, 31 Oct 2010 18:54:36 +0000
Subject: Bug #53214 [Fbk->Opn]: is_readable() returns false on readable files on windows network drive to linux
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-155660@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53214&edit=1

 ID:                 53214
 User updated by:    nevdelap at gmail dot com
 Reported by:        nevdelap at gmail dot com
 Summary:            is_readable() returns false on readable files on
                     windows network drive to linux
-Status:             Feedback
+Status:             Open
 Type:               Bug
 Package:            Filesystem function related
 Operating System:   Windows
 PHP Version:        5.3.3
 Block user comment: N

 New Comment:

The two scripts (identical except for the driver letters) are only to
make it 
explicit that one result is on C: - the local drive, which you asked
about - the 
answer is there, and the other N: - the remove drive.

Does it work with local filesystem as expected? - Yes - that is what C:
is 
showing.

What is used on the remote host? Samba? Which version? - VirtualBox does
the 
sharing. Not the remote host.

Please show one script and what you expect as output or result. - It is
the same 
script aside from the drive letters which just make it more explicit
what is 
happening.


Previous Comments:
------------------------------------------------------------------------
[2010-10-31 19:47:48] pajoye@php.net

Does it work with local filesystem as expected?

What is used on the remote host? Samba? Which version?

Why expected and actual results show two different scripts? 

Please show one script and what you expect as output or result.

Btw, the OS is about where PHP runs, not what you use on some remote
servers :)

------------------------------------------------------------------------
[2010-10-31 19:35:51] nevdelap at gmail dot com

Description:
------------
This is the setup I have.

Windows guest in a VirtualBox with a network drive connected to a
network share 
on the virtual machine to an ext3 directory on the Linux host.

In other words in Windows N: is connected to \\vboxsvr\nev which is the
directory 
/home/nev on the Linux box.

Php is_readable($file) where $file is a filename on the N: drive returns
false 
though the file is readable.

Test script:
---------------
<?php
	assert(!is_readable('N:\test.txt'));
	echo file_get_contents('N:\test.txt');
?>

Expected result:
----------------
If the test is on C:\ it works correctly. The assertion fails.

C:\test.txt contains the text 'this is a test'.

<?php
	assert(!is_readable('C:\test.txt'));
	echo file_get_contents('C:\test.txt');
?>

C:\>php test.php
PHP Warning:  assert(): Assertion failed in C:\test.php on line 2

Warning: assert(): Assertion failed in C:\test.php on line 2
this is a test
C:\>

Actual result:
--------------
N:\test.txt contains the text 'this is a test'.

<?php
	assert(!is_readable('N:\test.txt'));
	echo file_get_contents('N:\test.txt');
?>

Gives this result...

N:\>php test.php
this is a test
N:\>



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



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


Thread (8 messages)

« previous php.bugs (#155660) next »