- $tl->add_tapelabel($datestamp2, $label2, $comment);
- $tl->write("/path/to/tapefile");
+ $tl->add_tapelabel($datestamp2, $label2, $comment, 1);
+ # write it and unlock
+ $tl->write();
+
+ # If you already have a read only copy and want to modify it
+ # take a read only copy
+ my $tl = Amanda::Tapelist->new("/path/to/tapefile");
+ # reload and take lock
+ $tl->reload(1);
+ # modify the memory copy
+ tl->add_tapelabel($datestamp, $label);
+ $tl->add_tapelabel($datestamp2, $label2, $comment, 1);
+ # write it and unlock
+ $tl->write();