From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA26774; Tue, 14 May 2002 19:23:04 +0200 (MET DST) Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA26769 for caml-list@pauillac.inria.fr; Tue, 14 May 2002 19:23:03 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA25250 for ; Tue, 14 May 2002 18:16:34 +0200 (MET DST) Received: from laurelin.dementia.org ([208.167.88.73]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g4EGGX909474 for ; Tue, 14 May 2002 18:16:33 +0200 (MET DST) Received: (from jprevost@localhost) by laurelin.dementia.org (8.11.6/8.11.6) id g4EGJpr23541; Tue, 14 May 2002 12:19:51 -0400 (EDT) (envelope-from visigoth@cs.cmu.edu) X-Authentication-Warning: laurelin.dementia.org: jprevost set sender to visigoth@cs.cmu.edu using -f To: "Jens Olsson" Cc: caml-list@inria.fr Subject: Re: [Caml-list] Wildcard expansion/command line Q#2 References: <20020514143955.29190.qmail@operamail.com> From: John Prevost Date: 14 May 2002 12:19:50 -0400 In-Reply-To: <20020514143955.29190.qmail@operamail.com> Message-ID: <864rhad7mh.fsf@laurelin.dementia.org> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk >>>>> "jo" == Jens Olsson writes: jo> Hi again, as I dig more into the code of my program I realize jo> that I have some more questions. I just hope these hasn't as jo> obvious answers than my previous ones... :) {...} jo> But what happens if I want to go recursive? As I understand jo> it, the expansion made by the shell is *not* recursive jo> itself. If my wildcard is *.txt I will only get expanded names jo> for the current directory but not for any txt files in the jo> subdirectories. Is this a desired behaviour? This is another reason that this is external to programs. The typical solution is either to use a shell with a more extended syntax (zsh, for example) which lets you write "**/foo" to mean "foo in all subdirectories", or to use the program find possibly with the support of xargs. A typical example is: find . -type f -name \*.deleteme -print0 | xargs -0 rm If your program needs to do this work itself, it should implement its own system of globbing, much like find does. John. ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners