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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id ABA1C7EE51 for ; Tue, 9 Apr 2013 13:38:27 +0200 (CEST) Received-SPF: Neutral (mail2-smtp-roc.national.inria.fr: domain of Etienne.Andre@univ-paris13.fr does not assert whether or not 194.254.164.7 is permitted sender) identity=pra; client-ip=194.254.164.7; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="Etienne.Andre@univ-paris13.fr"; x-sender="Etienne.Andre@univ-paris13.fr"; x-conformance=sidf_compatible; x-record-type="spf2.0" Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of Etienne.Andre@univ-paris13.fr designates 194.254.164.7 as permitted sender) identity=mailfrom; client-ip=194.254.164.7; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="Etienne.Andre@univ-paris13.fr"; x-sender="Etienne.Andre@univ-paris13.fr"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@upn.univ-paris13.fr) identity=helo; client-ip=194.254.164.7; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="Etienne.Andre@univ-paris13.fr"; x-sender="postmaster@upn.univ-paris13.fr"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmQFAMn8Y1HC/qQHc2dsb2JhbABRFoMmr1sBknAIFg4BDAgMCRQoghaBJwEHXRIBBQGISQQInQ6Cco4gkD2PP4MrA5Z0hXCJOxYphDA X-IPAS-Result: AmQFAMn8Y1HC/qQHc2dsb2JhbABRFoMmr1sBknAIFg4BDAgMCRQoghaBJwEHXRIBBQGISQQInQ6Cco4gkD2PP4MrA5Z0hXCJOxYphDA X-IronPort-AV: E=Sophos;i="4.87,438,1363129200"; d="scan'208";a="12462810" Received: from upn.univ-paris13.fr ([194.254.164.7]) by mail2-smtp-roc.national.inria.fr with ESMTP; 09 Apr 2013 13:38:27 +0200 Received: from smtp.univ-paris13.fr (smtp.univ-paris13.fr [192.168.0.72]) by upn.univ-paris13.fr (Mail Server) with ESMTP id A2FB34C080 for ; Tue, 9 Apr 2013 13:38:27 +0200 (CEST) Received: from mail-ob0-f171.google.com (mail-ob0-f171.google.com [209.85.214.171]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated user : hidden) by smtp.univ-paris13.fr (Postfix) with ESMTPSA id BB4553EA0A7 for ; Tue, 9 Apr 2013 14:02:41 +0200 (CEST) Received: by mail-ob0-f171.google.com with SMTP id v19so3680004obq.16 for ; Tue, 09 Apr 2013 04:38:25 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.66.11 with SMTP id b11mr17983193obt.62.1365507505021; Tue, 09 Apr 2013 04:38:25 -0700 (PDT) Received: by 10.76.9.102 with HTTP; Tue, 9 Apr 2013 04:38:24 -0700 (PDT) Date: Tue, 9 Apr 2013 13:38:24 +0200 Message-ID: From: =?ISO-8859-1?Q?=C9tienne_Andr=E9?= To: caml-list@inria.fr Content-Type: multipart/alternative; boundary=e89a8fb1eac6c6b97f04d9ebfd8d Subject: [Caml-list] Build number and date in OCaml? --e89a8fb1eac6c6b97f04d9ebfd8d Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, I've been using OCaml for a couple of years, but without using any advanced feature; so my question may be a little naive. Is there any way to insert easily the current date and time of compiling, as well as, e.g., an incremental build number in an OCaml program? So that it is printed at runtime, e.g., in the program header. I quite stupidly used the Unix.gettimeofday() function before realizing that it is of course executed at runtime. Of course, I could do it using an external script that would modify the OCaml source code before compiling, but is there any native OCaml feature for achieving this in a cleaner manner? Thank you, -- =C9tienne Andr=E9 Universit=E9 Paris 13, Sorbonne Paris Cit=E9 http://www-lipn.univ-paris13.fr/~andre --e89a8fb1eac6c6b97f04d9ebfd8d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

I've been using OCaml for a couple of years, but without usi= ng any advanced feature; so my question may be a little naive.
Is there = any way to insert easily the current date and time of compiling, as well as= , e.g., an incremental build number in an OCaml program?
So that it is printed at runtime, e.g., in the program header.

I qui= te stupidly used the Unix.gettimeofday() function before realizing that it = is of course executed at runtime.

Of course, I could do it using an = external script that would modify the OCaml source code before compiling, b= ut is there any native OCaml feature for achieving this in a cleaner manner= ?

Thank you,
--
=C9tienne Andr=E9
Universit= =E9 Paris 13, Sorbonne Paris Cit=E9
http://www-lipn.univ-paris13.fr/~andre

--e89a8fb1eac6c6b97f04d9ebfd8d--