|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-03-26 20:34 UTC] neversaynever at tut dot by
Description:
------------
I upgraded my kernel to 2.6.31 (stable) and has php-5.2.12 (stable), but
php function is_dir() returns false for folder on my cifs mounted share.
strace php -r 'var_dump(is_dir("/path_to_mounted_folder/"));'
...
stat64("/path_to_mounted_folder/", {st_mode=S_IFDIR|0755, st_size=32768, ...}) = 0
gettimeofday({1269602972, 30466}, NULL) = 0
write(1, "bool(false)\n", 12bool(false)
) = 12
...
Test script:
---------------
php -r 'var_dump(is_dir("/path_to_mounted_folder/"));'
Expected result:
----------------
bool(true)
Actual result:
--------------
bool(false)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 07:00:01 2025 UTC |
I have to agree with the original poster. Running php 5.2.13 Under Gentoo I have problems with is_dir() on CIFS shares with 2.6.31 and 2.6.32. On a machine I have running 2.6.30 I don't see the issue. Here's a CIFS mounted directory that reports is_dir() as false even though chdir() reports true: php -r 'var_dump(is_dir("/home/tom/mount/sql"));' bool(false) php -r 'var_dump(chdir("/home/tom/mount/sql"));' bool(true) Here's the equivalent in perl that reports true: perl -e '(-d "/home/tom/mount/sql") && print "OK\n"' OK ls -ald /home/tom/mount/sql drwxr-xr-x 1 tom tom 0 Apr 28 2008 /home/tom/mount/sql That's a windows share mounted as administrator of the windows machine. While this may be caused somehow by CIFS changes in the kernel, there truely is something ugly going on here and it's caused me some serious problems. Tom