EXPT1
EXPT1
#include<stdio.h>
#include<fcntl.h>
#include<errno.h>
extern int errno;
int main()
{
int fd = open("os1.txt", O_RDONLY | O_CREAT);
printf("fd = %d \n ", fd);
if(fd == -1)
{
printf("Error Number %d \n", errno);
perror("Program");
return 0;
OUTPUT:
OUTPUT:
INPUT FOR WRITE C:
#include<unistd.h>
int main()
{
write(1,"HELLO BUDDY\n", 12);
}
OUTPUT:
return 0;
}
OUTPUT: