Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <fcntl.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <unistd.h>
  5. #include <errno.h>
  6.  
  7. int main(int argc, char * argv[])
  8. {
  9. int deskryptor = open(argv[1], O_WRONLY|O_CREAT, 0777);
  10. if(argc!=2)
  11. {
  12. fprintf(stderr,"Wywolaj program w formacie %s <nazwa_pliku_do_utworzenia>\n",argv[0]);
  13. exit(1);
  14. }
  15.  
  16. if(close(deskryptor)==-1){
  17. perror("Błąd zamknięcia pliku");
  18. exit(1);
  19. }
  20. exit(0);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement