/*A SMALL PROGRAM TO SHOW HOW OPEN SYSTEM CALL IS USED*/
#include<stdio.h>
#include<fcntl.h>//fcntl.h header file is neccessary to use system call
#include<stdlib.h>
#include<string.h>
int main()
{
int fd;//now fd is a normal variable...but it is going to be a special variable when open system call is used ..& return value to that open system call is preserved into fd...fd is file descriptor that is called stream of file that is opened..
//every file has its inode no. but fd - is a stream to that file ..means way by which data..arrives to that file ...in other words in could say ..its path..
fd=open("source",O_RDONLY);//1st argument is path of that file..& 2nd arg is mode in which that file is to open..now every time we want to read from the file..use this fd..as 1st arg to read from..