English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Sys.command and quotes
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-05-05 (09:45)
From: Sylvain Le Gall <sylvain@l...>
Subject: Re: Sys.command and quotes

On 05-05-2009, Matthieu Dubuget <matthieu.dubuget@gmail.com> wrote:
> Hello,
> I have a problem with mingw version of ocaml (compiled by hand, or with 
> godi).
> 1- Is the following reproducible?
> 2- If yes, do you consider this as a bug?
> It seems that in "Sys.command s", if the first and the last characters 
> of s are '"', they are elided?

In fact, I have done some testing about this sometimes ago and comme to
the conclusion that "-handling on windows is quite weird. If and only if
there is a space (or other problematic char) in your commannd/arg name
you can use quoting. Otherwise it will be reported as an error.

I think it is not directly related to OCaml.

Maybe, I am not totaly right with my conclusion, but I can give you a
simple tips: 

Use Unix.create_process et al that take array as arguments. It always
use the good quoting.

Sylvain Le Gall