php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50319 stat() / lstat() does not work on a mounted cifs
Submitted: 2009-11-28 19:46 UTC Modified: 2009-11-28 20:22 UTC
From: jpope at popes dot net Assigned:
Status: Not a bug Package: Streams related
PHP Version: 5.3.1 OS: Fedora 12
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
41 - 40 = ?
Subscribe to this entry?

 
 [2009-11-28 19:46 UTC] jpope at popes dot net
Description:
------------
stat() and lstat() functions fail when passed a file that is on a CIFS mounted file system.  This issue is the same as bug #50150.

Reproduce code:
---------------
#!/usr/bin/php
<?php
    $dirtoopen="/mnt/images/";
    $dir = opendir($dirtoopen);
    if($dir)
    {
        if($file = readdir($dir))
        {
                var_dump(stat("$dirtoopen$file"));
        }
        closedir($dir);
    }
    else
    {
        echo "Can't open dir  \"$dirtoopen\"\n";
    }
?>


Expected result:
----------------
array(26) {
  [0]=>
  int(64768)
  [1]=>
  int(11)
  [2]=>
  int(16832)
  [3]=>
  int(2)
  [4]=>
  int(0)
  [5]=>
  int(0)
  [6]=>
  int(0)
  [7]=>
  int(16384)
  [8]=>
  int(1259424478)
  [9]=>
  int(1188876522)
  [10]=>
  int(1227920384)
  [11]=>
  int(4096)
  [12]=>
  int(40)
  ["dev"]=>
  int(64768)
  ["ino"]=>
  int(11)
  ["mode"]=>
  int(16832)
  ["nlink"]=>
  int(2)
  ["uid"]=>
  int(0)
  ["gid"]=>
  int(0)
  ["rdev"]=>
  int(0)
  ["size"]=>
  int(16384)
  ["atime"]=>
  int(1259424478)
  ["mtime"]=>
  int(1188876522)
  ["ctime"]=>
  int(1227920384)
  ["blksize"]=>
  int(4096)
  ["blocks"]=>
  int(40)
}


Actual result:
--------------
PHP Warning:  stat(): stat failed for /mnt/images/. in /root/x on line 9
bool(false)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-28 20:18 UTC] jani@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.


 [2009-11-28 20:22 UTC] jpope at popes dot net
The existing bug has a status of bogus, but it's not bogus!!  If there were a resolution to this issue I would have do that rather than submit a bug.

Please investigate this issue further as it is clearly not bogus.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 21:01:28 2024 UTC