tags:

views:

24

answers:

1

I'm trying to open a file that I just created with open64(). When I try to open the file though, the syscall fails with ENOENT. I know for a fact the file exists, because I just created it and ls shows it in the directory it is supposed to be in. When I try to open it with open(), it fails with EOVERFLOW, which is expected, but it also implies the file exists. Any ideas?

const char* filename = pDt->evtfname;
int evtFile;
evtFile = open64(filename, O_RDONLY); 
perror("The following error occurred");
+2  A: 

What's evtFile value? You do not check it. errno is valid only if evtFile < 0

Drakosha
Great scott. It's 7. Thanks for the help. I guess I was under the impression errno was reset every syscall if successful.
xxpor