How to create a file and write 2 byte.Example.

How to create a file and write 2 byte.
Example.

#include <stdio.h >
#include <stdlib.h >
int main()
{
 int fd;

 pid_t pid;

 
 if ((fd = creat("myfile.txt", FILE_MODE)) < 0)

 err_sys("error on creat");

 if (write(fd, "mm", 2) != 2)

 err_sys("error on write");

 exit(0) ;

#c #unix #linux #ethicalhacker #programming

Commenti

Post popolari in questo blog