Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45584 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 77367 invoked from network); 17 Sep 2009 11:48:12 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Sep 2009 11:48:12 -0000 Authentication-Results: pb1.pair.com header.from=keisial@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=keisial@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.216 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: keisial@gmail.com X-Host-Fingerprint: 209.85.219.216 mail-ew0-f216.google.com Received: from [209.85.219.216] ([209.85.219.216:41722] helo=mail-ew0-f216.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FA/1D-29403-AF122BA4 for ; Thu, 17 Sep 2009 07:48:11 -0400 Received: by ewy12 with SMTP id 12so281123ewy.24 for ; Thu, 17 Sep 2009 04:48:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=gAvbPdnL+M3Qbau2oshmA79kSUrjghnjaX2j3S+3WqM=; b=uShwjUkdAWUf2tfEWWYCUAnitoYYRgaILTW1GGHZNTVM5gjlwMyiBHR3YfB4p7v8Ct FvY6k+46SSeCZMqBdcZQ+yNmDIaw8cCyve+XRf83MM3Lhj1YNzYmDk9siv9Uhr71iK3u IaR1AGiaWi6cXP1UIdNKWrR1wZv+a6qvFFcL4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=eptAXD37piJ+75nyRKbkYCf50xLcjq6QRPMrhly4y61JMuhO+nF0NWtX6JyP3VYUl7 6DPeHSeJ0cYDFxlvCWyoPx7bMc91j6XTXjUdE2aAOU1m8d0801hJ2I9rhA3SoAAQ1BJp HoGuViZ/1Z1rA5UEAzcm6cGKF9s6BP48CRNTg= Received: by 10.211.173.17 with SMTP id a17mr3604969ebp.77.1253188088161; Thu, 17 Sep 2009 04:48:08 -0700 (PDT) Received: from ?192.168.1.25? (226.Red-83-51-56.dynamicIP.rima-tde.net [83.51.56.226]) by mx.google.com with ESMTPS id 10sm1604277eyz.2.2009.09.17.04.48.06 (version=SSLv3 cipher=RC4-MD5); Thu, 17 Sep 2009 04:48:07 -0700 (PDT) Message-ID: <4AB221F6.1070504@gmail.com> Date: Thu, 17 Sep 2009 13:48:06 +0200 User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: Ian Tighe , internals@lists.php.net References: <3A8BE18A46C746E69582175E92E503AC@saturn> In-Reply-To: <3A8BE18A46C746E69582175E92E503AC@saturn> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Detecting share violations over cifs with PHP? Feature request From: keisial@gmail.com (Keisial) 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?