Advertisement
Guest User

crea_fichero.c

a guest
May 28th, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <string.h>
  3. #include <sys/types.h>
  4. #include <sys/stat.h>
  5. #include <fcntl.h>
  6.  
  7.  
  8.  
  9. main (int argc, char *argv[])
  10. {
  11.     int fd = creat("salida.txt", O_RDWR);
  12.     char buffer[6];
  13.     strcpy(buffer, "ABCD");
  14.         write (fd, buffer, strlen (buffer));
  15.     close(fd);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement