Re: Detecting share violations over cifs with PHP? Feature request

From: Date: Thu, 17 Sep 2009 11:48:06 +0000
Subject: Re: Detecting share violations over cifs with PHP? Feature request
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-45584@lists.php.net to get a copy of this message
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?

« previous php.internals (#45584) next »