[m-rev.] for review: add dir.current_directory

Julien Fischer juliensf at csse.unimelb.edu.au
Wed Sep 19 19:30:14 AEST 2007


On Wed, 19 Sep 2007, Peter Wang wrote:

> +:- pragma foreign_proc("C",
> +    dir.current_directory(Res::out, IO0::di, IO::uo),
> +    [may_call_mercury, promise_pure, tabled_for_io, terminates],
> +"
> +    size_t      size = 256;
> +    char        *buf;
> +    MR_String   str;
> +
> +    while (1) {
> +        buf = MR_GC_NEW_ARRAY(char, size);
> +        if (getcwd(buf, size)) {

Is getcwd() available on all systems?

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list