[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: freopen question
- From: "Kristofer Karlsson" <kristofer.karlsson@...>
- Date: Sat, 2 Feb 2008 13:53:58 +0100
First of all, please disregard Polarinas response. It was apparently a
joke about you writing Lua in caps, which is wrong, since it's not an
acronym.The mailing list is generally not this hostile!
Second of all I am not familiar with freopen but from reading
http://www.opengroup.org/onlinepubs/000095399/functions/freopen.html and
http://www.opengroup.org/onlinepubs/007908775/xsh/fclose.html it seems
your solution should work.
I suggest simply testing it, both in your actual project and for some
carefully constructed test cases if you're still uncertain!
On Feb 2, 2008 1:20 PM, Terisquas Brothers <terisquas@yahoo.co.uk> wrote:
> I'm trying to make LUA work in a platform where I have
> no freopen.
>
> I think there's just one appearance of freopen in the
> code, in luaL_loadfile. Is it safe to modify it from
>
> lf.f = freopen(filename, "rb", lf.f); /* reopen
> in binary mode */
>
> to
>
> if (lf.f!=NULL) fclose (lf.f);
> lf.f=fopen (filename,"rb");
>
>
> ?
>
>
> Is that a correct equivalence? (the truth is I've
> never seen freopen until now...)
>
>
> TIA
> Kak
>
>
> ___________________________________________________________
> Support the World Aids Awareness campaign this month with Yahoo! For Good http://uk.promotions.yahoo.com/forgood/
>