From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id 1F9617ED34 for ; Tue, 3 Jul 2012 10:25:42 +0200 (CEST) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.160.182; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail1-smtp-roc.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.160.182 as permitted sender) identity=mailfrom; client-ip=209.85.160.182; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-gh0-f182.google.com) identity=helo; client-ip=209.85.160.182; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-gh0-f182.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiQCAFer8k/RVaC2kGdsb2JhbABFhVqgEZB1CCIBAQEBCQkNBxQEI4IYAQEBBBICDx0BGxILAQMMBgULDQICCR0CAiIBEQEFAQoSBhMICgkHh1oBAwsLnDIJA4tUT4JxhVMKGScDCleIcQEFDIEUihiFCIESA5U1gRKNFD6EAA X-IronPort-AV: E=Sophos;i="4.77,514,1336341600"; d="scan'208";a="165378147" Received: from mail-gh0-f182.google.com ([209.85.160.182]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 03 Jul 2012 10:25:41 +0200 Received: by ghbz22 with SMTP id z22so7465770ghb.27 for ; Tue, 03 Jul 2012 01:25:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=aRgsT3Wg7qPy1hEkGglo8ir4PTuLgCvbfyycN9ZGRms=; b=diWGgmfiRBnUk05Sme7rWgq4jcIBlvbJsX7v6661lsdGXjYDK5bPpXcE6yl40Zkmnr rgijB/xe0Cl7Nv7LVcoSd3NPeCAvVmviRLUyY0DUFo/ALxv8SAQGIkARqUAYOfFJY45m ps61hgFkn1elVIZHbKoiFXo09rlmzZzCqHyd8nioN6zlfhN9gBgMFdnYZHTwCRI1Y2uY GVQk5PHoydYgDPqHhyMceuqryjuEKdFEk6ZYGN6ffSG434Ku/nG0hHoT1tyAmnGmxnPI DA7n/73ypZ5ql4Fdh1TIxnodXa0Oz8O1v0Ua2Vvm+ZUo0OVXieC+7AfszwpHcM/1R+tJ IFGQ== Received: by 10.50.237.71 with SMTP id va7mr7597000igc.6.1341303940052; Tue, 03 Jul 2012 01:25:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.94.39 with HTTP; Tue, 3 Jul 2012 01:24:59 -0700 (PDT) In-Reply-To: <481061341303698@web18d.yandex.ru> References: <271211341286221@web29f.yandex.ru> <4FF28EEA.7060009@glondu.net> <481061341303698@web18d.yandex.ru> From: Gabriel Scherer Date: Tue, 3 Jul 2012 10:24:59 +0200 Message-ID: To: Ivan Cc: =?ISO-8859-1?Q?St=E9phane_Glondu?= , "caml-list@inria.fr" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] howto: recursively iterate over filesystem 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 wrote: > Mer=D1=81i, 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 rea= l 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 m= odule > 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=C3=A9phane Glondu" : >> Le 03/07/2012 05:30, Ivan a =C3=A9crit : >> >>> 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=C3=A9phane >> >> -- >> 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 >