[m-rev.] for review: Call mdb 'list' external command using posix_spawnp.

Zoltan Somogyi zoltan.somogyi at runbox.com
Tue Oct 6 12:51:36 AEDT 2020


2020-10-06 12:37 GMT+11:00 "Peter Wang" <novalazy at gmail.com>:
> I'll post a test for review.

I just had a look, and the test is fine.

> We would need to open and read the file to enforce the high limit,
> which is inefficient and unnecessary as the listing implementation would
> do that anyway. I think we can expect external commands to silently
> ignore limits that are greater than the number of lines in a file.
> 
> The problem with a negative line number is that, when passed as an
> argument, -INT is likely to be mistaken for an option of some sort.

That is a good reason for the asymmetry.

>> Have you considered adding posix_spawn/spawnp to extras/posix?
> 
> It's a lot more work to generalise it to be suitable for a library.
> I also wouldn't find it useful myself, as I find it more fruitful to
> program to low-level C APIs directly within larger foreign code blocks,
> rather than (trying to) program C in Mercury syntax.

Ok.

Zoltan.


More information about the reviews mailing list