Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45585 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 86736 invoked from network); 17 Sep 2009 12:35:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Sep 2009 12:35:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=ian.tighe@latitude-51.co.uk; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ian.tighe@latitude-51.co.uk; sender-id=pass Received-SPF: pass (pb1.pair.com: domain latitude-51.co.uk designates 80.235.207.146 as permitted sender) X-PHP-List-Original-Sender: ian.tighe@latitude-51.co.uk X-Host-Fingerprint: 80.235.207.146 pluto.renegade-hosting.co.uk Received: from [80.235.207.146] ([80.235.207.146:53293] helo=pluto.renegade-hosting.co.uk) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BA/81-13341-50D22BA4 for ; Thu, 17 Sep 2009 08:35:19 -0400 Received: from localhost (unknown [127.0.0.1]) by pluto.renegade-hosting.co.uk (Postfix) with ESMTP id F1A2DAF0447; Thu, 17 Sep 2009 12:35:13 +0000 (UTC) X-Virus-Scanned: Scanned by Consulting Ian Tighe @ renegade-hosting.co.uk Received: from pluto.renegade-hosting.co.uk ([127.0.0.1]) by localhost (pluto.renegade-hosting.co.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jBRmlvMGl7iq; Thu, 17 Sep 2009 13:35:11 +0100 (BST) Received: from saturn (saturn.renegade-hosting.co.uk [192.168.0.2]) by pluto.renegade-hosting.co.uk (Postfix) with SMTP id C54E7AF0471; Thu, 17 Sep 2009 13:35:11 +0100 (BST) Message-ID: <1545DFB6BD704A44A4CB7C1B6EF3B5D1@saturn> To: "Keisial" , References: <3A8BE18A46C746E69582175E92E503AC@saturn> <4AB221F6.1070504@gmail.com> Date: Thu, 17 Sep 2009 13:35:11 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.5843 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Subject: Re: [PHP-DEV] Detecting share violations over cifs with PHP? Feature request From: ian.tighe@latitude-51.co.uk ("Ian Tighe") Hi , I am using readdir with a view to selecting files for opening and reading or just taking a stat of them. I am doing this recursively. I test the output from readdir to see if its a file or dir or link etc and this works well. This suddenly changes though and an item is returned by readdir (that is a filename) but its type cannot be determined - it is not of any type at all! So looking at a wireshark trace revealed there had been a sharing violation but I was blissfully unaware of this. I am seeking to have such an error condition made available so that ANY i/o op can be tested not just for true or false but to further establish the i/o outcome and hence track sharing violations amongst other errors. Apart from the type issue above, my substantive point about readdir was this: If I get a false reply I am not sure if I had a failed i/o operation or I had come to the end of a directory list. As far as I can see ( and I may be wrong of course ) there is for PHP no difference between the two but the impact is significantly different. It was more to demonstrate that error reporting is fairly clumsy in these circumstances. It is certainly true all the files I have seen so far that cause this problem related to either iTunes or Microsoft - especially internet explorer 8 recovery files. It must be they are exclusively locked and any attempt by my software makes to read them brings about a violation which cannot be detected, cannot be recovered from and thus not handled by me. I cannot reliably repeat it as I can barely detect it other than my software will carry on looking for files and directories and not being able to recognise types and actions I wanted are not carried out. I have a wireshark trace of the smb protocol exchanges if that helps but it basically says trans2 query path request, trans2 query path response , create_andx request (which is probably a stat), which is retried several times and finally a create andx response indicating a sharing violation. If I could get hold of that in PHP I could react............. Thanks Ian ----- Original Message ----- From: "Keisial" To: "Ian Tighe" ; Sent: Thursday, September 17, 2009 12:48 PM Subject: Re: [PHP-DEV] Detecting share violations over cifs with PHP? Feature request > Ian Tighe wrote: >> Hi. I hope this has been sent to the right place. >> I am using files that are mount.cif share files. My client is a samba >> linux box but acting as a client over cifs to an XP box (several in >> fact). >> I am descending the share recursively with opendir and readdir detecting >> files ( and of course directories ) before doing my processing. >> I note from a wireshark trace I am getting errors - sharing violations >> reported by XP. I would very much like to detect these events to take >> action - ignore the file for instance - but right now I have a true or >> false return from readdir, is_dir, is_file or is_link which is not very >> helpful during a fault condition such as a sharing violation. In other >> words a sharing violation looks like a readdir saying no more files! >> >> It seems that once the error condition comes about all my reads of a >> directory and tests of file types fail until I reach the end of that >> directory and all of its parent directories. This is not so good. >> >> Am I missing a trick here? If not is it possible to bring out more error >> information so that I can detect these events. An error array as an >> additional overloaded argument to readdir, opendir (indeed any I/O) where >> the first element has the normal true/false perhaps but a second element >> has a return code for smb/cifs/file_system failure/error/warning >> condition? >> >> Thanks >> >> Ian >> > What are you doing that triggers that error? I would expect a sharing > violation to be related to trying to read/write files opened exclusively > by other program, not by traversing a directory tree. Do you know how to > reproduce it? > >