From: Eric Cooper <ecc@cmu.edu>
To: caml-list@inria.fr
Subject: Re: [Caml-list] howto: recursively iterate over filesystem
Date: Tue, 3 Jul 2012 08:04:45 -0400 [thread overview]
Message-ID: <20120703120445.GA19608@cooper-siegel.org> (raw)
In-Reply-To: <544301341307534@web17d.yandex.ru>
On Tue, Jul 03, 2012 at 01:25:34PM +0400, Ivan wrote:
>
>
> 03.07.2012, 12:46, "Fabrice Le Fessant" <fabrice@lefessant.net>:
> > let rec iter_dir f dirname =
> > let files = Sys.readdir dirname in
> > Array.iter (fun file ->
> > let file = Filename.concat dirname file in
> > (f file : unit);
> > if Sys.is_directory file then iter_dir f file
> > ) files
> >
> > ?
>
> Yes, this is exactly what I want. Thanks!
>
> P.S. Didn't thought that it will be so simple.
Note that this won't terminate when there are symbolic links that
create cycles.
--
Eric Cooper e c c @ c m u . e d u
next prev parent reply other threads:[~2012-07-03 12:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-03 3:30 Ivan
2012-07-03 3:42 ` Rudi Grinberg
2012-07-03 6:19 ` Stéphane Glondu
2012-07-03 8:21 ` Ivan
2012-07-03 8:24 ` Gabriel Scherer
2012-07-03 8:33 ` Ivan
2012-07-03 8:45 ` Adrien
2012-07-03 8:46 ` Fabrice Le Fessant
2012-07-03 9:25 ` Ivan
2012-07-03 12:04 ` Eric Cooper [this message]
2012-07-03 12:28 ` Daniel Bünzli
2012-07-03 19:50 ` [Caml-list] " Sylvain Le Gall
2012-07-03 12:14 ` [Caml-list] " Daniel Bünzli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120703120445.GA19608@cooper-siegel.org \
--to=ecc@cmu.edu \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox