Hi, I have the following code in C
long from = atol(buffer);
printf("From: %ld\n", from);
int file_fd = open(fullPath, O_RDONLY);
if (file_fd == -1) error("Error opening file");
if (from > -1)
{
int a = lseek(file_fd, from, SEEK_SET);
if (a == -1)
error("Error in lseek");
}
The lseek operation is returning Error in lseek: Invalid argument, as a result of
void error(char *msg)
{
perror(msg);
exit(1);
}
Do you have any idea how can I debug it so I can find out what's wrong? I thought it was very trivial but it's driving me crazy.
Thanks