Michael Norrish wrote:
On my Intel Macbook Pro running 10.5.8, I get
SysErr ("Operation not supported", SOME ENOTSUP)
On a Linux michaeln-desktop 2.6.31-21-generic #59-Ubuntu SMP Wed Mar 24
07:28:56 UTC 2010 i686 GNU/Linux
I get:
--
Poly/ML 5.3 Release
> Posix.Process.exec ("/bin/ls", []);
Warning-The type of (it) contains a free type variable. Setting it to a
unique
monotype.
Segmentation fault
--
On a slightly different Linux atp-login1 2.6.26-2-686 #1 SMP Wed Aug 19
06:06:52 UTC 2009 i686 GNU/Linux
I get the expected behaviour...
--
I tried this out under the debugger and found it was actually "ls"
itself that was crashing. I suspect the reason for the difference in
behaviour has to do with differences in the implementation of "/bin/ls"
on different platforms. When calling Posix.Process.exec you have to
pass all the arguments including the first item which is conventionally
the name of the program. So you should always be calling it as
Posix.Process.exec("/bin/ls", ["ls"]);
I seem to recall that this changed in the 5.3 release from previous
releases which included the program name in the argument list
automatically but the Standard Basis library documentation clearly says
that the new implementation is correct. I guess one of the reasons is
that some programs actually do different things when invoked by
different names.
David
_______________________________________________
polyml mailing list
[email protected]
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml