[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: read error
- From: Rebel Neurofog <rebelneurofog@...>
- Date: Tue, 8 Nov 2011 19:21:17 +0300
///////////// 'main.c':
#include <stdio.h>
#include <assert.h>
#include <dirent.h>
int main ()
{
DIR *dir = opendir (".");
assert (dir);
int fd = dirfd (dir);
char buffer[64];
assert (!dup2 (fd, 0));
char* argv[] = {"./script.lua", NULL};
char* envp[] = {NULL};
execve ("./script.lua", argv, envp);
return 0;
}
------------- 'script.lua':
print (io.read ("*a"))