Skip to content
Snippets Groups Projects
Commit b667cfcc authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

First version

Rev: src/modules/files/sendfiletest.pike:1.1
parent dfe13958
No related branches found
No related tags found
No related merge requests found
......@@ -399,6 +399,7 @@ testfont binary
/src/modules/files/file.c foreign_ident
/src/modules/files/file.h foreign_ident
/src/modules/files/sendfile.c foreign_ident
/src/modules/files/sendfiletest.pike foreign_ident
/src/modules/files/socket.c foreign_ident
/src/modules/files/socktest.pike foreign_ident
/src/modules/files/termios.c foreign_ident
......
#!/usr/local/bin/pike
/* $Id: sendfiletest.pike,v 1.1 1999/10/14 20:52:01 grubba Exp $ */
void done(int sent)
{
rm("conftest.Makefile");
exit(0);
}
int main(int argc, array(string) argv)
{
object from = Stdio.File();
object to = Stdio.File();
if (!from->open("Makefile", "r")) {
werror("Failed to open \"Makefile\" for reading!\n");
exit(1);
}
if (!from->open("conftest.Makefile", "cwt")) {
werror("Failed to open \"conftest.Makefile\" for writing!\n");
exit(1);
}
mixed err = catch {
if (!Stdio.sendfile(0, from, 0, -1, 0, to, done)) {
werror("Stdio,sendfile() failed!\n");
exit(1);
}
return(-1);
};
catch {
werror("Stdio.sendfile() failed!\n"
"%s\n",
describe_backtrace(err));
};
exit(1);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment