]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/patches/testing/t.c
ebl update
[bacula/bacula] / bacula / patches / testing / t.c
index 64b7f47761fb52c7cb1ccce3546090dacd7275b4..f668680d6c39a0abce19d65920d44eb41181e59b 100644 (file)
@@ -30,6 +30,10 @@ int main()
    struct mtop mt_com;
 
    fd  = open("/dev/lto2", O_CREAT | O_RDWR, 0700);
+   if (fd < 0) {
+      perror("Can't open fd");
+      exit(1);
+   }
 
    /* rewind */
    mt_com.mt_count = 1;
@@ -45,6 +49,18 @@ int main()
    printf("write something (3 writes)\n");
    print_pos();
 
+   /* write EOF */
+   printf("WEOF\n");
+   mt_com.mt_op = MTWEOF;
+   mt_com.mt_count = 1;
+   r1 = ioctl(fd, MTIOCTOP, &mt_com);
+   print_pos();
+
+   /* write a second file */
+   write(fd, "abcdefghijklmnopqrstuvwyz", strlen("abcdefghijklmnopqrstuvwyz")+1);
+   printf("write something\n");
+   print_pos();
+
    /* rewind */
    mt_com.mt_count = 1;
    mt_com.mt_op = MTREW;
@@ -135,7 +151,12 @@ int main()
    r1 = ioctl(fd, MTIOCTOP, &mt_com);
    printf("goto eom\n");
    print_pos();
-   
+
+   /* write something */
+   printf("write something\n");
+   write(fd, "abcdefghijklmnopqrstuvwyz", strlen("abcdefghijklmnopqrstuvwyz")+1);
+   print_pos();
+
    close(fd);
    return(0);
 }