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: 2021-08-08 04:22 UTC
Votes:4
Avg. Score:3.5 ± 1.7
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:2 (66.7%)
From: arnout dot boks at moxio dot com Assigned: cmb (profile)
Status: No Feedback Package: *Directory/Filesystem functions
PHP Version: 5.6.10 OS: Windows 7
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [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.
 [2021-07-29 16:37 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-07-29 16:37 UTC] cmb@php.net
Is this still an issue with any of the actively supported PHP
versions[1]?  If so, what does

    fsutil reparsePoint query U:

report (both offline and online mode)?

[1] <https://www.php.net/supported-versions.php>
 [2021-08-08 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Dec 01 01:03:43 2022 UTC