Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Wed, 3 Jul 2002 16:20:46 +0200 From: Thomas Baker To: Cygwin Cc: Conrad Scott Subject: Cygwin "find" stopping before done...? Message-ID: <20020703162045.A2116@mail.gmd.de> Mail-Followup-To: Thomas Baker , Cygwin , Conrad Scott References: <20020626125840 DOT A576 AT mail DOT gmd DOT de> <0dde01c21d05$d11a7810$6132bc3e AT BABEL> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <0dde01c21d05$d11a7810$6132bc3e@BABEL>; from Conrad.Scott@dsl.pipex.com on Wed, Jun 26, 2002 at 12:37:10PM +0100 To generate a list of all files on my e: partition: find e:/ -type f >c:/backups/filenames/edrive-files However, this "find" command consistently stops before even starting to read the final directory (462 MB large, with 19,000 files). When I use the MKS version of the find command it reads this directory along with the others with no problem. I had earlier had a problem with "grep foobar *" under Cygwin (but again, not with MKS) and it turned out to be an understandable and known limitation easily resolvable by using "xargs" (see below). And in the case of grep, I was warned by an error message of the problem with grep. In the case of "find", the command line itself is not (I should think) expanding into something too big to process, but I was assuming that find was in fact designed to plow through long directory trees. Even if this is not the case, it's not clear to me how xargs could provide a workaround here. This problem with "find" seems particularly insidious because it executes and exits with no error message so I naturally assume it has completed its work successfully -- even when this is not the case. Since in other contexts I rely on "find" to help back up my data files, the consequences of an undetected error such as the one described above could be disastrously disruptive to my work. Has anyone else had this problem? Tom On Wed, Jun 26, 2002 at 12:37:10PM +0100, Conrad Scott wrote: > "Thomas Baker" wrote: > > One difficulty I have found, however, is limitations (or so > > it would seem) on the number of arguments that the command > > "grep" can take. > > You can't (portably) rely on anything much more than a few thousand > characters in a single command line. The minimum requirement for a > Posix system is 4096 (see ). The usual technique is to use > `xargs', as: > > ls | xargs grep pattern > > (or even `ls | xargs grep pattern /dev/null' to catch the case with > only one argument being given to grep and it changing behaviour). > > This splits up the incoming arguments and invokes grep repeatedly, a > batch of the arguments at a time. It's particularly useful with `find' > and it's got lots of lovely options to play with too :-) > > It would be nice to allow arbitrary command lines, but I've never > (knowingly) used a system that did so. > > // Conrad > > > -- Dr. Thomas Baker Thomas DOT Baker AT bi DOT fhg DOT de Institutszentrum Schloss Birlinghoven mobile +49-171-408-5784 Fraunhofer-Gesellschaft work +49-30-8109-9027 53754 Sankt Augustin, Germany fax +49-2241-144-1408 -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/