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 492D67ED34 for ; Tue, 3 Jul 2012 14:04:51 +0200 (CEST) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of ecc@cmu.edu) identity=pra; client-ip=128.2.217.198; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="ecc@cooper-siegel.org"; x-sender="ecc@cmu.edu"; x-conformance=sidf_compatible Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of ecc@cooper-siegel.org) identity=mailfrom; client-ip=128.2.217.198; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="ecc@cooper-siegel.org"; x-sender="ecc@cooper-siegel.org"; x-conformance=sidf_compatible Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@smtp03.srv.cs.cmu.edu) identity=helo; client-ip=128.2.217.198; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="ecc@cooper-siegel.org"; x-sender="postmaster@smtp03.srv.cs.cmu.edu"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhYCAOre8k+AAtnGkWdsb2JhbABFtmoiAQEBAQkLCwcUBSKCGAEBAQQnCwFWCxgcEhQYRIgLsj6JBIs4gn6CPGADlTSSfw X-IronPort-AV: E=Sophos;i="4.77,515,1336341600"; d="scan'208";a="165414133" Received: from smtp03.srv.cs.cmu.edu ([128.2.217.198]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 03 Jul 2012 14:04:50 +0200 Received: from stratocaster.home (pool-108-17-121-184.pitbpa.fios.verizon.net [108.17.121.184]) (authenticated bits=0) by smtp03.srv.cs.cmu.edu (8.13.6/8.13.6) with ESMTP id q63C4lHt002790 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 3 Jul 2012 08:04:48 -0400 (EDT) Received: by stratocaster.home (Postfix, from userid 1000) id 961D51D06781; Tue, 3 Jul 2012 08:04:45 -0400 (EDT) Date: Tue, 3 Jul 2012 08:04:45 -0400 From: Eric Cooper To: caml-list@inria.fr Message-ID: <20120703120445.GA19608@cooper-siegel.org> Mail-Followup-To: caml-list@inria.fr References: <271211341286221@web29f.yandex.ru> <4FF28EEA.7060009@glondu.net> <481061341303698@web18d.yandex.ru> <544301341307534@web17d.yandex.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <544301341307534@web17d.yandex.ru> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: mimedefang-cmuscs on 128.2.217.198 Subject: Re: [Caml-list] howto: recursively iterate over filesystem On Tue, Jul 03, 2012 at 01:25:34PM +0400, Ivan wrote: > > > 03.07.2012, 12:46, "Fabrice Le Fessant" : > > 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