lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Monday 23 May 2005 03:33, William Trenker wrote:
[...]
>     int ok = (pclose(f) != -1) || (fclose(f) == 0);     // <<<---
> PROBLEM IS HERE

Yes, this is a known problem (it fails on my platform, too). It's actually a 
Posix violation, but just happens to work on most platforms.

The problem is that fixing would require some pretty hefty rewriting of the 
way files are managed (because you need to store whether the FILE* came from 
popen() or fopen(), which means you need another word of storage, which means 
you can't store the FILE* in a lightuserdata), and, well, no-one's got around 
to doing it yet.

But it's good to know that it fails on uclibc as well as my wacky OS.

-- 
+- David Given --McQ-+ "You cannot truly appreciate _Atlas Shrugged_
|  dg@cowlark.com    | until you have read it in the original Klingon."
| (dg@tao-group.com) | --- Sea Wasp on r.a.sf.w
+- www.cowlark.com --+