WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

RE: [Xen-API] [PATCH] Add function to Date module to assert ISO 8601 dat

To: Rob Hoes <Rob.Hoes@xxxxxxxxxx>, xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-API] [PATCH] Add function to Date module to assert ISO 8601 datetime values are UTC
From: Dave Scott <Dave.Scott@xxxxxxxxxxxxx>
Date: Wed, 1 Sep 2010 17:22:36 +0100
Accept-language: en-US
Acceptlanguage: en-US
Cc:
Delivery-date: Wed, 01 Sep 2010 09:22:50 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <E1OqmkK-00080d-0M@xxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <E1OqmkK-00080d-0M@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: ActJ1A2IY8tnwTmrSy26VT6YThpKQAAHb0uw
Thread-topic: [Xen-API] [PATCH] Add function to Date module to assert ISO 8601 datetime values are UTC
Hi Rob,

Is the Str module threadsafe? ISTR there was something dodgy about it in a 
threaded environment.

> +let assert_utc x =
> +     let r = Str.regexp "^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]T[0-
> 9][0-9]:[0-9][0-9]:[0-9][0-9]Z$" in
> +     if not (Str.string_match r x 0) then
> +             invalid_arg x
> +


Cheers,
Dave

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api