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 XAA03100; Tue, 23 Apr 2002 23:50:09 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id XAA03143 for ; Tue, 23 Apr 2002 23:50:04 +0200 (MET DST) Received: from hirsch.in-berlin.de (hirsch.in-berlin.de [192.109.42.6]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g3NLo3v13150 for ; Tue, 23 Apr 2002 23:50:03 +0200 (MET DST) Received: from hirsch.in-berlin.de (localhost [127.0.0.1]) by hirsch.in-berlin.de (8.12.1/8.12.1/Debian -2) with ESMTP id g3NLo2sP000938 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NOT) for ; Tue, 23 Apr 2002 23:50:02 +0200 Received: (from uucp@localhost) by hirsch.in-berlin.de (8.12.1/8.12.1/Debian -2) with UUCP id g3NLo2Rw000926 for caml-list@inria.fr; Tue, 23 Apr 2002 23:50:02 +0200 X-Envelope-From: oliver@first.in-berlin.de X-Envelope-To: caml-list@inria.fr Received: from localhost (oliver@localhost) by first.in-berlin.de (8.7.6/8.7.3) with SMTP id XAA10046 for ; Tue, 23 Apr 2002 23:48:39 +0200 Date: Tue, 23 Apr 2002 23:48:38 +0200 (MET DST) From: Oliver Bandel To: caml-list@inria.fr Subject: [Caml-list] Stack Overflow... (recursion in try-statement) Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello, why does an stack overflow-error occur here? let rec traversedir dir = try ( [Unix.readdir dir] @ traversedir dir ) with End_of_file -> [];; I have not tried it with very deep directories, so I did not expect such an error... What is the problem here? This function is a predecessor of later directory- traversing processing stuff: With this function I try to traverse directories. Later versions of it should be expanded, so that I can give as parameters a filetype and a function, which will be applied to all files of a special filetype => and that recursively. (e.g.: moving all regular files or renaming all directories or similar things) How can I do such recursively filesystem-traversing? How can I handle such things without running into stack-overflows? Ciao, Oliver ------------------- 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