Re: Problem with ghc on Windows ME

2004-01-29 Thread C.Reinke
> No, the effect is that the arguments are passed unmodified to the > program. The implementation of rawSystem might have to do some > compensation under the hood (eg. on Windows), but that's not visible to > the client. As I've learned to interpret the uncompensated arguments, I'd prefer a rawS

Re: Problem with ghc on Windows ME

2004-01-29 Thread Glynn Clements
C.Reinke wrote: > Therefore, my suggestion would be to keep the rawSystem from > ghc-6.0.1 (which doesn't seem to do any interpretation?), and > to provide a system-specific escape function > > System.Cmd.escape :: String -> String -> String > -- (System.Cmd.escape chars string) escapes occu

RE: Problem with ghc on Windows ME

2004-01-29 Thread Simon Marlow
> > It's called 'raw' because it is supposed to get the > arguments through > > *unmodified* to the called program. No file globbing, no > escape stuff, nothing. > > That's exactly what I'm worried about: it seems that rawSystem is > *not* passing the arguments unmodified, but tries to compen

RE: Problem with ghc on Windows ME

2004-01-29 Thread Carl Witty
On Thu, 2004-01-29 at 03:31, Simon Marlow wrote: > > So does that mean functionality has been lost in the move from > > ghc-6.0.1? > > No, the behaviour is improved in 6.2 because we're now careful to escape > quotes before passing the command-line to the operating system. > > I think confusion

Re: detecting memory size?

2004-01-29 Thread Joachim Durchholz
Ketil Malde wrote: What I really want is the amount of memory my application can allocate and excercise lively without causing thrashing. On my Linux computer, that amounts more or less to the installed, physical RAM, minus a bit, so I'll settle for that. :-) An easier way would be to make this a

Re: Problem with ghc on Windows ME

2004-01-29 Thread Joachim Durchholz
Simon Marlow wrote: After Googling around a bit, I found this description of exactly how Windows interprets command lines in the C runtime: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccelng/htm/progs_12.asp Note that this is how the startup code of programs compiled with a

Re: Network problem with ghc on WinXP

2004-01-29 Thread Sigbjorn Finne
Me neither; I'm guessing it goes back to the days when PortNumber used to be a type synonym (and synonyms could/had to be exported with (..).) --sigbjorn - Original Message - From: "Simon Marlow" <[EMAIL PROTECTED]> To: "Sigbjorn Finne" <[EMAIL PROTECTED]>; "robin abraham" <[EMAIL PROTEC

GHC-6.2 and Template Haskell on OS X

2004-01-29 Thread Gregory Wright
Hi, I have a question about ghc-6.2 and template haskell on Mac OS X. I think it's a ghc configuration or build issue, so I'm posting here instead of the TH list. I have ghc-6.2 built under darwinports. This uses a 6.0.1 binary to bootstrap the 6.2 build. I haven't updated the binary bootstra

Re: Problem with ghc on Windows ME

2004-01-29 Thread C.Reinke
> It's called 'raw' because it is supposed to get the arguments through > *unmodified* to the called program. No file globbing, no escape stuff, > nothing. That's exactly what I'm worried about: it seems that rawSystem is *not* passing the arguments unmodified, but tries to compensate for windows

Re: Problem with ghc on Windows ME

2004-01-29 Thread Carsten Schultz
On Thu, Jan 29, 2004 at 02:53:21PM -, Simon Marlow wrote: > After Googling around a bit, I found this description of exactly how > Windows interprets command lines in the C runtime: > > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccelng > /htm/progs_12.asp > > As you can

RE: Problem with ghc on Windows ME

2004-01-29 Thread Simon Peyton-Jones
Well found! Still, I found I could not understand the rules. But I think the story this Convert \" to \\\" otherwise convert " to \" otherwise do no conversion I think it's probably easiest to express this directly: translate :: String -> String translate str

RE: Problem with ghc on Windows ME

2004-01-29 Thread Simon Peyton-Jones
It's called 'raw' because it is supposed to get the arguments through *unmodified* to the called program. No file globbing, no escape stuff, nothing. Plain 'system' invokes the shell, and therefore does file globbing. Anything about escaping in rawSystem is an internal implementation matter S

RE: Problem with ghc on Windows ME

2004-01-29 Thread Simon Marlow
After Googling around a bit, I found this description of exactly how Windows interprets command lines in the C runtime: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccelng /htm/progs_12.asp As you can see, the rules are indeed very strange, but they are invertible. I think t

RE: Problem with ghc on Windows ME

2004-01-29 Thread Simon Marlow
> > The > implementation of > > rawSystem will attempt to compensate for the internal > translation that > > Windows does on the command-line; on Unix no translation is > necessary. > > So clients of rawSystem should be more portable, because

Re: Problem with ghc on Windows ME

2004-01-29 Thread Malcolm Wallace
"Simon Marlow" <[EMAIL PROTECTED]> writes: > The implementation of > rawSystem will attempt to compensate for the internal translation that > Windows does on the command-line; on Unix no translation is necessary. > So clients of rawSystem should be

Re: detecting memory size?

2004-01-29 Thread Ketil Malde
Glynn Clements <[EMAIL PROTECTED]> writes: > IIRC, getrlimit(RLIMIT_DATA) doesn't mean much on Linux, as it doesn't > include memory which is added using mmap(..., MAP_ANON), which is used > by glibc's malloc(). Also, getrlimit(RLIMIT_RSS) is probably more > relevant for your purposes. I also got

Re: detecting memory size?

2004-01-29 Thread Glynn Clements
Ketil Malde wrote: > > What do you mean by "memory size"? How much RAM is installed in the > > system? The amount which the process is currently using? The amount > > which the OS might be willing to allocate to your process at any given > > point in time? Something else? > > My aplogies for bei

Re: detecting memory size?

2004-01-29 Thread Ketil Malde
Glynn Clements <[EMAIL PROTECTED]> writes: > What do you mean by "memory size"? How much RAM is installed in the > system? The amount which the process is currently using? The amount > which the OS might be willing to allocate to your process at any given > point in time? Something else? My aplog

Re: detecting memory size?

2004-01-29 Thread Glynn Clements
Ketil Malde wrote: > Is it possible to detect memory (i.e. RAM, not virtual memory) size What do you mean by "memory size"? How much RAM is installed in the system? The amount which the process is currently using? The amount which the OS might be willing to allocate to your process at any given

RE: Problem with ghc on Windows ME

2004-01-29 Thread Simon Marlow
> So does that mean functionality has been lost in the move from > ghc-6.0.1? No, the behaviour is improved in 6.2 because we're now careful to escape quotes before passing the command-line to the operating system. I think confusion has arisen because Simon pointed out that there's no way, on W

RE: Network problem with ghc on WinXP

2004-01-29 Thread Simon Marlow
Is there a reason not to export PortNumber abstractly? I can't think of one off-hand. Cheers, Simon > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf > Of Sigbjorn Finne > Sent: 29 January 2004 06:37 > To: robin abraham > Cc: [EMAIL PROTECTED

detecting memory size?

2004-01-29 Thread Ketil Malde
Hi, Is it possible to detect memory (i.e. RAM, not virtual memory) size from inside a Haskell program (so that I can keep my program from growing too large with consequent thrashing)? And if so, to what degree of portability? -kzm -- If I haven't seen further, it is by standing in the footpri

Re: Network problem with ghc on WinXP

2004-01-29 Thread robin abraham
Works like a charm now :) Thank you for the insight. Robin. >Hi there, > >looks like a network byte-order vs host byte-order gotcha. >Never use the PortNum constructor, but declare 'portnum' >to have type PortNumber and simply drop the use of PortNum >in your code alltogether. Alternatively, use i