caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Stack Overflow... (recursion in try-statement)
@ 2002-04-23 21:48 Oliver Bandel
  2002-04-23 22:23 ` Will Benton
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Oliver Bandel @ 2002-04-23 21:48 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2002-07-01 11:45 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-23 21:48 [Caml-list] Stack Overflow... (recursion in try-statement) Oliver Bandel
2002-04-23 22:23 ` Will Benton
2002-04-23 22:50 ` Oliver Bandel
2002-04-23 23:25   ` John Prevost
2002-05-21 18:34     ` [Caml-list] Is CVS version of ocaml faster? John Max Skaller
2002-05-22  3:03       ` Jacques Garrigue
2002-05-22 16:29         ` John Max Skaller
2002-06-30 17:25     ` [Caml-list] ocamllex -- ambiguous regex John Max Skaller
2002-07-01 11:45       ` Xavier Leroy
2002-06-30 17:27     ` [Caml-list] Manual broken -- set John Max Skaller
2002-04-24  1:01 ` [Caml-list] Stack Overflow... (recursion in try-statement) Warp
2002-04-24 13:22   ` Oliver Bandel
2002-04-24  4:10 ` John Prevost
2002-04-24  4:52 ` Alan Schmitt
2002-04-24  5:31   ` Charles Martin
2002-04-24 13:25   ` Oliver Bandel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).