GHCi-5.04.2: Windows Open with ... problem.

Calle Lejdfors calle.lejdfors@cs.lth.se
Wed, 12 Feb 2003 14:33:42 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_0056_01C2D2A3.BE02C530
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi

Thanks for the answer. It appears as if XP calls ghci via

"p::\ath\to\ghci" "c:\Documents and Settings\foo\...."

i.e. with quotes.=20

Trying to start ghci via cygwin using any of=20

$ ghci Test\ with\ spaces/Test.lhs=20
$ ghci Test\ with\ spaces\\Test.lhs=20
$ ghci "Test with space/Test.lhs"

$ ghci "Test with space\\Test.lhs"

will give the error: can't find module `Test' (while processing "Test")

Testing=20

$ ghci Test\ with\ spaces/Test.lhs=20
$ ghci "Test with space/Test.lhs"


under Linux gives the same error.=20

Hence there seem to be something strange about pathnames containing =
spaces under GHCi.

However trying the same thing under GHC works like a charm under both =
cygwin and Linux.

Any ideas?

/Calle


----- Original Message -----=20
  From: Sigbjorn Finne=20
  To: Calle Lejdfors=20
  Cc: glasgow-haskell-users@haskell.org=20
  Sent: Tuesday, February 11, 2003 3:19 PM
  Subject: Re: GHCi-5.04.2: Windows Open with ... problem.


  Hi thee,

  this is most likely due to the XP shell invoking 'ghci' as follows:

    p:\ath\to\ghci c:\Documents and Settings\foo\....

  which makes it look as if multiple arguments are given on the
  command-line (indeed, that's what the argv vector will contain.)

  The registered file assocations for .hs and .lhs takes care of quoting
  the filename argument, so I'm not sure this is worth fixing.

  --sigbjorn

  Enterprising souls may want to have a look at the Registry key

    HKEY_CLASSES_ROOT\Unknown\shell\openas\command

  and look at how the %1 arg is quoted (or not)....
    ----- Original Message -----=20
    From: Calle Lejdfors=20
    To: glasgow-haskell-users@haskell.org=20
    Sent: Tuesday, February 11, 2003 02:02
    Subject: GHCi-5.04.2: Windows Open with ... problem.


    Hello.

    I am having a problem using the Open with ... on haskell-files under =
WinXP. The problem is this: create a file on my desktop and then =
right-click and try to open it using Open with -> ghci. I get the =
following error message:

    can't find module `C:\Documents' (while processing "C:\\Documents")

    Obviously GHCi incorrectly handles white space in the path. If I run =
under Cygwin I can use a script like:

    c:\\ghc\\ghc-5.04.2\\bin\\ghci `cygpath -d $1`;

    But how do I solve this if I'm not using cygwin?=20

    Thanks, Calle
------=_NextPart_000_0056_01C2D2A3.BE02C530
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type=20
content=3D"text/html; charset=3Diso-8859-1"><DEFANGED_META=20
content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3D"Content-Type"><DEFANGED_META=20
content=3D"MSHTML 6.00.2800.1126"=20
name=3D"GENERATOR"><!-- <DEFANGED_STYLE> --></DEFANGED_STYLE>
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks for the answer. It appears as if =
XP calls=20
ghci via</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>"p::\ath\to\ghci" "c:\Documents and=20
Settings\foo\...."</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>i.e. with quotes. </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Trying to start ghci via cygwin using =
any of=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT><FONT face=3DArial =
size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>$ ghci Test\ with\ spaces/Test.lhs =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>$ ghci Test\ with\ spaces\\Test.lhs =
</FONT></DIV>$=20
ghci "Test with space/Test.lhs"</FONT><BR>
<DIV><FONT face=3DArial size=3D2>$ ghci "Test with =
space\\Test.lhs"<BR></FONT><FONT=20
face=3DArial size=3D2></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>will give the error: </FONT><FONT =
face=3DArial=20
size=3D2>can't find module `Test' (while processing "Test")</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Testing </FONT></DIV>
<DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>$ ghci Test\ with\ spaces/Test.lhs =
</FONT></DIV>
<DIV>$ ghci "Test with space/Test.lhs"<BR></DIV>
<DIV>&nbsp;</DIV>
<DIV>under Linux gives the same error. </DIV>
<DIV>&nbsp;</DIV>
<DIV>Hence there seem to be something strange about pathnames containing =
spaces=20
under GHCi.</DIV>
<DIV>&nbsp;</DIV>
<DIV>However trying the same thing under GHC works like a charm under =
both=20
cygwin and Linux.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Any ideas?</DIV>
<DIV>&nbsp;</DIV>
<DIV>/Calle</DIV></DIV></FONT></DIV></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV>----- Original Message ----- </DIV></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A title=3Dsof@galois.com href=3D"mailto:sof@galois.com">Sigbjorn =
Finne</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
title=3Dcalle.lejdfors@cs.lth.se=20
  href=3D"mailto:calle.lejdfors@cs.lth.se">Calle Lejdfors</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Cc:</B> <A=20
  title=3Dglasgow-haskell-users@haskell.org=20
  =
href=3D"mailto:glasgow-haskell-users@haskell.org">glasgow-haskell-users@h=
askell.org</A>=20
  </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Tuesday, February 11, =
2003 3:19=20
  PM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> Re: GHCi-5.04.2: =
Windows Open=20
  with ... problem.</DIV>
  <DIV><FONT face=3DArial size=3D2></FONT><FONT face=3DArial =
size=3D2></FONT><BR></DIV>
  <DIV><FONT face=3DArial size=3D2>Hi thee,</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>this is most likely due to the XP =
shell invoking=20
  'ghci' as follows:</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>&nbsp; p:\ath\to\ghci c:\Documents =
and=20
  Settings\foo\....</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>which makes it look as if multiple =
arguments are=20
  given on the</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>command-line (indeed, that's what the =
argv vector=20
  will contain.)</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>The registered file assocations for =
.hs and .lhs=20
  takes care of quoting</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>the filename argument, so I'm not =
sure this is=20
  worth fixing.</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>--sigbjorn</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>Enterprising souls may want to have a =
look at the=20
  Registry key</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>&nbsp;=20
  HKEY_CLASSES_ROOT\Unknown\shell\openas\command</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>and look at how the %1 arg is quoted =
(or=20
  not)....</FONT></DIV>
  <BLOCKQUOTE dir=3Dltr=20
  style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
    <DIV DEFANGED_STYLE=3D"FONT: 10pt arial">----- Original Message =
----- </DIV>
    <DIV=20
    style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
    <A title=3Dcalle.lejdfors@cs.lth.se=20
    href=3D"mailto:calle.lejdfors@cs.lth.se">Calle Lejdfors</A> </DIV>
    <DIV DEFANGED_STYLE=3D"FONT: 10pt arial"><B>To:</B> <A=20
    title=3Dglasgow-haskell-users@haskell.org=20
    =
href=3D"mailto:glasgow-haskell-users@haskell.org">glasgow-haskell-users@h=
askell.org</A>=20
    </DIV>
    <DIV DEFANGED_STYLE=3D"FONT: 10pt arial"><B>Sent:</B> Tuesday, =
February 11,=20
    2003 02:02</DIV>
    <DIV DEFANGED_STYLE=3D"FONT: 10pt arial"><B>Subject:</B> =
GHCi-5.04.2: Windows=20
    Open with ... problem.</DIV>
    <DIV><BR></DIV>
    <DIV><FONT face=3D"Courier New" size=3D2>Hello.</FONT></DIV>
    <DIV><FONT face=3D"Courier New" size=3D2></FONT>&nbsp;</DIV>
    <DIV><FONT face=3D"Courier New"><FONT size=3D2>I am having a problem =
using the=20
    Open with ... on haskell-files under WinXP. The problem is this:=20
    </FONT><FONT size=3D2>create a file on my desktop and then =
right-click and try=20
    to open it using Open with -&gt; ghci. I get the following error=20
    message:</FONT></FONT></DIV>
    <DIV><FONT face=3D"Courier New" size=3D2></FONT>&nbsp;</DIV>
    <DIV><FONT face=3D"Courier New" size=3D2>can't find module =
`C:\Documents' (while=20
    processing "C:\\Documents")</FONT></DIV>
    <DIV><FONT face=3D"Courier New" size=3D2></FONT>&nbsp;</DIV>
    <DIV><FONT face=3D"Courier New" size=3D2>Obviously GHCi incorrectly =
handles=20
    white space in the path. If I run under Cygwin&nbsp;I can use a =
script=20
    like:</FONT></DIV>
    <DIV><FONT face=3D"Courier New" size=3D2></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2>c:\\ghc\\ghc-5.04.2\\bin\\ghci =
`cygpath -d=20
    $1`;<BR></FONT></DIV>
    <DIV><FONT face=3DArial size=3D2>But how do I solve this if I'm not =
using=20
    cygwin? </FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2>Thanks,=20
Calle</DIV></BLOCKQUOTE></BLOCKQUOTE></FONT></BODY></HTML>

------=_NextPart_000_0056_01C2D2A3.BE02C530--