Ohhh, nevermind. It works right now
Heres the code:
Code:
#include <unistd.h>
#include <fcntl.h>
int main(int argc, char **argv)
{
int i;
int x;
int b;
int fd;
char buffer[1];
i = 1;
b = 1;
x = 1;
if (argc <= 1)
{
my_putstr("Usage: Please enter 1 or more parameters");
my_putstr("\n");
}
while (i < argc)
{
fd = open(argv[i], O_RDONLY);
if (!fd)
{
my_putstr("Error reading file");
my_putstr("\n");
}
else
{
while (x)
{
x = read(fd, buffer, sizeof(buffer));
lseek(fd, b, SEEK_SET);
my_putstr(buffer);
b++;
}
}
i++;
}
return (0);
}
But it refuses to work for more than one parameter.