caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: Ivan <ivg@ieee.org>
Cc: "Stéphane Glondu" <steph@glondu.net>,
	"caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] howto: recursively iterate over filesystem
Date: Tue, 3 Jul 2012 10:24:59 +0200	[thread overview]
Message-ID: <CAPFanBF-Y7o9fgTsi9BcJX0kVtmAcPwpb_zUVBqLDYa9VZDWTg@mail.gmail.com> (raw)
In-Reply-To: <481061341303698@web18d.yandex.ru>

Have you tried the dead simple solution first, with Sys.readdir and
Sys.is_directory from the standard library (
http://caml.inria.fr/pub/docs/manual-ocaml/libref/Sys.html ), to see
if it suits your need? You can always switch to richer but more
complex alternatives if you have more specific needs later.

On Tue, Jul 3, 2012 at 10:21 AM, Ivan <ivg@ieee.org> wrote:
> Merсi, it looks nice! But I didn't understand what's the issue with links. The FilePath.mli file contains a
> warning, that I've failed to understand:
>   32     This module manipulate abstract path that are not bound to a real filesystem.
>   33     In particular, it makes the assumption that there is no symbolic link that
>   34     should modify the meaning of a path. If you intend to use this module
>   35     against a real set of filename, the best solution is to apply to every
>   36     filename to solve symbolic link through {!FileUtil.readlink}.
>
> In my situation a folder, which I'd like to traverse, is plenty of links.
> Maybe someone can clarify it for me?
>
> 03.07.2012, 10:19, "Stéphane Glondu" <steph@glondu.net>:
>> Le 03/07/2012 05:30, Ivan a écrit :
>>
>>>  Are there any libraries that allow to walk through a filesystem (linux
>>>  filesystem in particular). At best I would like to find some library
>>>  that provides an ``iter'' function that will recursively iterate over
>>>  files and subdir in the given folder. At the very best, a library
>>>  resembling (by functionality) boost.filesystem will be very nice.
>>
>> http://forge.ocamlcore.org/projects/ocaml-fileutils/
>>
>> Cheers,
>>
>> --
>> Stéphane
>>
>> --
>> Caml-list mailing list.  Subscription management and archives:
>> https://sympa-roc.inria.fr/wws/info/caml-list
>> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
>> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa-roc.inria.fr/wws/info/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>

  reply	other threads:[~2012-07-03  8:25 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 [this message]
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
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=CAPFanBF-Y7o9fgTsi9BcJX0kVtmAcPwpb_zUVBqLDYa9VZDWTg@mail.gmail.com \
    --to=gabriel.scherer@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=ivg@ieee.org \
    --cc=steph@glondu.net \
    /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;
as well as URLs for NNTP newsgroup(s).