In a POSIX environment when using system calls to manipulate text files (open(), close(), read(), write()
), is there a way to to check to see if I actually closed a file descriptor when using close(file_descriptor)
?
Example:
int main(int argc, char **argv)
{
int input_file; // file descriptor for input file
int output_file; // file descriptor for output file
input_file = open(argv[1], O_RDONLY));
ouput_file = open(argv[2], ...file properties & permissions and crap.....);
// blah blah blah...
close(input_file);
close(output_file);
// what can I code here to check if the file descriptor was actually closed?
}