From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 832AA7FD8E for ; Fri, 5 Feb 2016 12:02:21 +0100 (CET) IronPort-PHdr: 9a23:gj/TOR0BTY2704TGsmDT+DRfVm0co7zxezQtwd8ZsegeKvad9pjvdHbS+e9qxAeQG96LtLQe0aGP4ujJYi8p39WoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6kO74TNaIBjjLw09fr2zQd6NyZ7tnLnjs7ToICx2xxOFKYtoKxu3qQiD/uI3uqBFbpgL9x3Sv3FTcP5Xz247bXianhL7+9vitMU7q3cY6Lod8JtFWLnmf6U1UPpUET47PG0pzMLuvBjHCwCI4z9UeWwTll9MAhPZpEXxV5L19y/7rfZV2S+APMSwQ6piChq46KI+YRvhiSFPGSQ462rXwph5iKtaplSvvR1kyI78ZIyFNfR/OKjaeIVJFiJ6Qs9NWnkZUcuHZIwVAr9ZMA== Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=alain.frisch@lexifi.com; spf=None smtp.mailfrom=alain.frisch@lexifi.com; spf=None smtp.helo=postmaster@mx30.yaziba.net Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of alain.frisch@lexifi.com) identity=pra; client-ip=82.138.71.21; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="alain.frisch@lexifi.com"; x-sender="alain.frisch@lexifi.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of alain.frisch@lexifi.com) identity=mailfrom; client-ip=82.138.71.21; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="alain.frisch@lexifi.com"; x-sender="alain.frisch@lexifi.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mx30.yaziba.net) identity=helo; client-ip=82.138.71.21; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="alain.frisch@lexifi.com"; x-sender="postmaster@mx30.yaziba.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DuAwDpgLRWnBVHilJEGoQMbQGELoQsswEhhDyBMAKBODwQAQEBAQEBAQEQAQEBAQEICwkJIS6CLYIVAQEEIxVRCxgCAgUhAgIPAkYGAQwIAQEXiAQKLLA8jmwBAQEBBgEBAQEBG3uFF4Q3hzKBOgWNJ4lOhUyIBIIlhnyFUo48AjeCPxyBNWkBiXsBAQE X-IPAS-Result: A0DuAwDpgLRWnBVHilJEGoQMbQGELoQsswEhhDyBMAKBODwQAQEBAQEBAQEQAQEBAQEICwkJIS6CLYIVAQEEIxVRCxgCAgUhAgIPAkYGAQwIAQEXiAQKLLA8jmwBAQEBBgEBAQEBG3uFF4Q3hzKBOgWNJ4lOhUyIBIIlhnyFUo48AjeCPxyBNWkBiXsBAQE X-IronPort-AV: E=Sophos;i="5.22,399,1449529200"; d="scan'208";a="163313452" Received: from mx30.yaziba.net ([82.138.71.21]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 05 Feb 2016 12:01:58 +0100 Received: from mta10.int.yaziba.net (unknown [217.117.151.14]) by mx30.yaziba.net (mx10.yaziba.net) with ESMTP id 35E9E1A740D; Fri, 5 Feb 2016 12:01:57 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mta10.int.yaziba.net (Postfix) with ESMTP id 745BACA659; Fri, 5 Feb 2016 12:01:57 +0100 (CET) X-Virus-Scanned: amavisd-new at mta10.int.yaziba.net Received: from mta10.int.yaziba.net ([127.0.0.1]) by localhost (mta10.int.yaziba.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LdAA9IVdnSy2; Fri, 5 Feb 2016 12:01:57 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mta10.int.yaziba.net (Postfix) with ESMTP id 4E150CA65B; Fri, 5 Feb 2016 12:01:57 +0100 (CET) X-Virus-Scanned: amavisd-new at mta10.int.yaziba.net Received: from mta10.int.yaziba.net ([127.0.0.1]) by localhost (mta10.int.yaziba.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Vgl7b90SQaQm; Fri, 5 Feb 2016 12:01:57 +0100 (CET) Received: from [10.0.210.51] (unknown [185.23.92.144]) by mta10.int.yaziba.net (Postfix) with ESMTPSA id 2F321CA659; Fri, 5 Feb 2016 12:01:57 +0100 (CET) To: matthieu.dubuget@gmail.com, Caml-list References: <56B47F51.5030001@gmail.com> From: Alain Frisch Message-ID: <56B48122.30303@lexifi.com> Date: Fri, 5 Feb 2016 12:01:54 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <56B47F51.5030001@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-DRWEB-SCAN: ok X-VRSPAM-SCORE: 0 X-VRSPAM-STATE: legit X-VRSPAM-CAUSE: gggruggvucftvghtrhhoucdtuddrfeekjedrvddvgddujecutefuodetggdotefrucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpjgetkgfkueetnecuuegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesthejrgdttdefjeenucfhrhhomheptehlrghinhcuhfhrihhstghhuceorghlrghinhdrfhhrihhstghhsehlvgigihhfihdrtghomheqnecuffhomhgrihhnpehinhhrihgrrdhfrhdpghhithhhuhgsrdgtohhmnecurfgrrhgrmhepmhhouggvpehsmhhtphhouhht X-VRSPAM-EXTCAUSE: mhhouggvpehsmhhtphhouhht Subject: Re: [Caml-list] Looking for a windows ocaml UTF-16 encoded filename aware library Hello, The real solution is to fix OCaml so that it can interact properly with arbitrary filenames under Windows. See: https://github.com/ocaml/ocaml/pull/153 http://caml.inria.fr/mantis/view.php?id=3771 The basic idea is that filenames are represented by OCaml strings representing an utf-8 encoding of the actual filename. To reduce code breakage, a fallback interprets strings that are invalid utf-8 sequences using the current code page. But this is still a rather intrusive change, since filenames received from readdir are always utf-8 encoded, which can break existing code. (One could imagine providing two variants of readdir to smooth the migration path.) Any help reviewing and testing the PR above would be very much appreciated! Alain On 05/02/2016 11:54, Matthieu Dubuget wrote: > Hello, > > I'm currently analysing a NTFS file-tree with a windows OCaml native application. > > This application is using: > - Unix.{opendir,readdir,closedir} > - and Unix.LargeFile.lstat > > The unix library of OCaml distribution is using ANSI variants of system functions. This is working fine until files or directories whose UTF-16 encoded name cannot be converted into the code page in use are reached. > > I'm about to write a small library to solve this problem: it would mimic the corresponding code from OCaml unix library, but using WIDE variants of microsoft system functions in the C stub instead of ANSI variants. > > Before going on: do you know of any library that already do this I could use? > > Thanks for any link. > > Salutations >