Bug #69834 [NEW]: is_readable returns false for Windows Offline File, but file can be read

From: Date: Mon, 15 Jun 2015 08:24:55 +0000
Subject: Bug #69834 [NEW]: is_readable returns false for Windows Offline File, but file can be read
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-193499@lists.php.net to get a copy of this message
From:             arnout dot boks at moxio dot com
Operating system: Windows 7
PHP version:      5.6.10
Package:          *Directory/Filesystem functions
Bug Type:         Bug
Bug description:is_readable returns false for Windows Offline File, but file can be read

Description:
------------
PHP's is_readable function seems to always return false for a file that
has been made available offline using the Windows Offline Files
functionality
(http://windows.microsoft.com/en-us/windows/understanding-offline-files#1TC=windows-7)
in offline mode, even if the file can be read using fread and related
functions. If the offline share is put back into online mode,
is_readable returns true again.

I experience this problem both for shares hosted on Windows and on Linux
(using Samba).

Test script:
---------------
<?php
// 'U:' is network share that has been made 'Always available' using
Windows Offline Files
// 'test.txt' is an existing file that can be read and written by the
user running PHP
var_dump(is_readable('U:/test.txt'));
$fp = fopen('U:/test.txt', 'r');
var_dump($fp);


Expected result:
----------------
bool(true)
resource(#) of type (stream)

Actual result:
--------------
// When the share is in offline mode ('Work offline')
bool(false)
resource(5) of type (stream)

// When the share is in online mode ('Work online')
bool(true)
resource(5) of type (stream)

-- 
Edit bug report at https://bugs.php.net/bug.php?id=69834&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=69834&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=69834&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=69834&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=69834&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=69834&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=69834&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=69834&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=69834&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=69834&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=69834&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=69834&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=69834&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=69834&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69834&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=69834&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=69834&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=69834&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69834&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=69834&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=69834&r=mysqlcfg



Thread (4 messages)

« previous php.bugs (#193499) next »