php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69834 is_readable returns false for Windows Offline File, but file can be read
Submitted: 2015-06-15 08:24 UTC Modified: -
Votes:3
Avg. Score:3.0 ± 1.6
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (50.0%)
From: arnout dot boks at moxio dot com Assigned:
Status: Open Package: *Directory/Filesystem functions
PHP Version: 5.6.10 OS: Windows 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: arnout dot boks at moxio dot com
New email:
PHP Version: OS:

 

 [2015-06-15 08:24 UTC] arnout dot boks at moxio dot com
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)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-12-23 23:31 UTC] ulf at dvlp dot de
Same Problem with PHP 7.0.0 on Windows 10.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Aug 19 21:01:27 2019 UTC