file_demo.c
changeset 131 b5ad49852adc
parent 77 49e0babccb23
child 138 dff18d1ac2af
equal deleted inserted replaced
130:f4b424b93e45 131:b5ad49852adc
    20 
    20 
    21     if (argc != 2)
    21     if (argc != 2)
    22         return -1;
    22         return -1;
    23     mode = strtoul (argv[1], NULL, 8);
    23     mode = strtoul (argv[1], NULL, 8);
    24 
    24 
    25     system ("/bin/rm -f /home/mbroeker/Desktop/test1.txt");
    25     if (system ("/bin/rm -f /home/mbroeker/Desktop/test1.txt") != 0)
    26     system ("/bin/rm -f /home/mbroeker/Desktop/test2.txt");
    26         return EXIT_FAILURE;
       
    27     if (system ("/bin/rm -f /home/mbroeker/Desktop/test2.txt") != 0)
       
    28         return EXIT_FAILURE;
    27 
    29 
    28     /*
    30     /*
    29      * Opens ReadOnly
    31      * Opens ReadOnly
    30      */
    32      */
    31     fd1 = open ("/home/mbroeker/Desktop/test1.txt", O_CREAT, mode);
    33     fd1 = open ("/home/mbroeker/Desktop/test1.txt", O_CREAT, mode);