[ ghc-Bugs-1175454 ] System.system fails on windows98se,
also disables ghci's :!
Claus Reinke
claus.reinke at talk21.com
Tue Apr 5 08:26:42 EDT 2005
[don't want to reopen the ticket, don't like the mini comment field
on sf, and I no longer trust the handling of "\" on sf (see below);
so I'll reply here]
> I've fixed this, 6.4.1 should be better (though I can't test
> it, so I'd appreciate it if you would test a pre-release
> when the time comes).
Thanks. COMMAND.COM may still exist on newer windows
versions, which would allow you to do some testing by setting
%COMSPEC%? (ms/intel try to be backwards compatible with
their first abacus;)
But I'm looking forward to a first working windows release
candidate!-) when? and what about the ctrl-c horrors?
> I can use rawSystem to invoke cmd.exe /c here. eg. this works:
>
> rawSystem "c:\windows\system32\cmd.exe" ["/c", "dir"]
hey, who are you trying to fool now?-) the above isn't even legal Haskell!
[there are double backslashes in the sourceforge version, but not in
the ghc-bugs version????? I keep staring at your email, but I still can't
believe this!]
Appended at the end is a recap of what happens on my windows98se
system. Note that with separate option, there's an error message and
no listing, and with option/parameter as a single element, the "dir" at
least gets executed, but the error message is still there. If that works for
you, without errors, it almost sounds as if rawSystem is cmd.exe-specific,
instead of command-interpreter-independent, as was the idea? Or at
least it doesn't cooperate with COMMAND.COM (perhaps the syscall
you use works differently on win98?..).
Btw, I can produce the same effects within COMMAND.COM if I
put parts of the command line in quotes (don't know whether that
is a misleading coincidence or a useful hint):
D:\cygwin\home\unknown>command.com /c cd
D:\cygwin\home\unknown
D:\cygwin\home\unknown>command.com "/c" "cd"
Angegebenes COMMAND-Verzeichnis ist falsch
Befehl oder Dateiname nicht gefunden.
D:\cygwin\home\unknown>command.com "/c cd"
Angegebenes COMMAND-Verzeichnis ist falsch
D:\cygwin\home\unknown
D:\cygwin\home\unknown>
Cheers,
Claus
$ ghci
___ ___ _
/ _ \ /\ /\/ __(_)
/ /_\// /_/ / / | | GHC Interactive, version 6.4, for Haskell 98.
/ /_\\/ __ / /___| | http://www.haskell.org/ghc/
\____/\/ /_/\____/|_| Type :? for help.
Loading package base-1.0 ... linking ... done.
Prelude>
Prelude> System.Cmd.rawSystem "c:\windows\command.com" ["/c","dir"]
<interactive>:1:26: lexical error in string/character literal
Prelude> System.Cmd.rawSystem "c:\\windows\\command.com" ["/c","dir"]
Angegebenes COMMAND-Verzeichnis ist falsch
Befehl oder Dateiname nicht gefunden.
Prelude> System.Cmd.rawSystem "c:\\windows\\command.com" ["/c dir"]
Angegebenes COMMAND-Verzeichnis ist falsch
Datenträger in Laufwerk D: hat keine Bezeichnung
Seriennummer des Datenträgers: 417D-08FC
Verzeichnis von D:\cygwin\home\unknown
. <DIR> 06.04.02 21:34 .
.. <DIR> 06.04.02 21:34 ..
BASHRC~1 300 22.03.05 15:06 .bashrc
BASH_H~1 9.605 05.04.05 2:42 .bash_history
VIMINF~1 10.659 02.04.05 19:40 .viminfo
SSH~1 <DIR> 11.06.02 0:12 .ssh
CVSPAS~1 45 22.06.02 20:51 .cvspass
INDEX~1 HTM 52.045 10.06.03 23:27 index.html
BASHRC~2 302 19.03.05 13:14 .bashrc~
GETNAME PL 140 24.09.03 14:27 getname.pl
EMACS~1 D <DIR> 31.10.03 15:37 .emacs.d
_VIMINFO 8.430 29.05.04 16:26 _viminfo
FONTS~1 CAC 0 04.07.04 14:04 .fonts.cache-1
9 Datei(en) 81.526 Bytes
4 Verzeichnis(se) 165.695.488 Bytes frei
Prelude>
Prelude> System.Cmd.rawSystem "c:\\windows\\command.com" ["/c echo %PATH%"]
Angegebenes COMMAND-Verzeichnis ist falsch
"
More information about the Glasgow-haskell-bugs
mailing list