Re: Results from is_dir() not consistent with documentation (?)
| From: | Tom Rogers | Date: | Thu, 01 May 2003 01:29:45 +0000 |
| Subject: | Re: Results from is_dir() not consistent with documentation (?) | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-145887@lists.php.net to get a copy of this message | ||
Hi,
Thursday, May 1, 2003, 10:33:56 AM, you wrote:
>> Explain 'weird' and someone may be able to help.
JBS> Sorry, I thought I did that in the first post...
JBS> (from initial post)
>>I'm writing a script, part of which traverses a directory tree by opening a
>>directory with opendir(), getting file handles, testing them to see if they
>>are directories with is_dir(), and if they are then it opens them using
>>opendir(), and soforth. It;'s a recursive function, and it seems to work
>>nicely on the linux server.
>>
>>The trouble starts when trying to run it on the IIS server. Rather than
>>have to rewrite the entire script and copy everything across to the other
>>server, I mounted the NTFS share to the linux server using mount -t smb
>>(etc...).
>>
>>The unusual thing is that from here, is_dir() only seems to work on a
>>percentage of the files. The documentation suggests that it returns a
>>boolean, however in practise it is returning 1's or 0's for some files, but
>>is returning nothing at all for others...! So some of the directories are
>>returning 1, others nothing. Some of the non-directory files are returning
>>0, others nothing.
JBS> Cheers,
JBS> Jason
Sorry about that, I missed the original...
Looks like the stat system over smb is not 100% reliable.
Maybe on the null ones you could try changing to it as if it was a
directory and if that fails then it is not a directory..
Messy but I don't know enough about smb mounts to help.
--
regards,
Tom