In File IO both fopen and open have same work but their methods of working and areas of use are different. Me explaining here the appropriate reasons b/w both functions:;
**Lesser System calls
1.fopen is a library function call , it means fopen has been defined in a header file ,you should simply write it in your program by taking it's header file and it is dependent on library function .
whereas open is a system call , like fopen ,open is also used by giving it's appropriate header file but,it is totally system dependent ,as it has been defined for the use of Unix based system ,and it directly interacts with the kernal.
Following example will satisfy you:
As we know open syntax arguments are:
fd = Open("file",Mode);
Suppose you want to read a file by single single character.By the referral of open syntax for reading like above your system call will increase according to file's content.
You will put read syntax : read (fd, buffer, 1);
Now every time read function is forcing Open function to interacting with kernal to read a single character.(see read syntax)
But when we are using fopen then we have only one system call as you fopen function need argument of buffer:
Now whether we want to read/write single character or all characters , firstly in both cases total no. of bytes or character size must be mentioned at noc. Now all data is firstly fetched in buffer and the provided to you for read/write by either single character or all characters.Thus we have only one system call.That is of the buffer .After that buffer data is supplied to us in application layer.
Thus we see fopen requires very less system call and as we know if we have less system call obviously our system performance will improve to process and execution and will be available to handle another process.
***Portability
2. One more thing is noticeable, that is the benefit of portability, as you know fopen is library function call and it has been defined in appropriate headers file so it is present in every system whether it is Unix or other os having c installation. But open is a system call and it is only for Unix based Operating systems. So if you have written any code using fopen then you can easily run it either on Unix based os or on other OS of c plateform. But by open you can't do such.