view getline.c @ 13:51e9b6b85edd

Fixed up rotation, now supports arbitrary rotation around, x, y, and z (in that order)
author Josef "Jeff" Sipek <jeffpc@optonline.net>
date Fri, 02 Dec 2005 23:04:10 -0500
parents 43c7ce2fc334
children cc1adef5674e
line wrap: on
line source

#include <unistd.h>
#include <fcntl.h>

int main(int argc, char** argv)
{
	char c;
	int fd;

	if (argc < 2)
		write(2, "error", 5);

	if ((fd = open(argv[1], O_RDONLY | O_NONBLOCK)) == -1)
		write(2, "error", 5);

	while((read(fd, &c, 1) == 1) && (c != '\n'))
		write(1, &c, 1);

	return 0;
}