#include "stored.h"
#include "findlib/find.h"
-#if defined(HAVE_CYGWIN) || defined(HAVE_WIN32)
-int win32_client = 1;
-#else
-int win32_client = 0;
-#endif
-
static void do_extract(char *fname);
static bool record_cb(DCR *dcr, DEV_RECORD *rec);
static void usage()
{
fprintf(stderr, _(
-"Copyright (C) 2000-2005 Kern Sibbald.\n"
+"Copyright (C) 2000-%s Kern Sibbald.\n"
"\nVersion: %s (%s)\n\n"
"Usage: bextract <options> <bacula-archive-device-name> <directory-to-store-files>\n"
" -b <file> specify a bootstrap file\n"
" -p proceed inspite of I/O errors\n"
" -v verbose\n"
" -V <volumes> specify Volume names (separated by |)\n"
-" -? print this message\n\n"), VERSION, BDATE);
+" -? print this message\n\n"), BYEAR, VERSION, BDATE);
exit(1);
}
my_name_is(argc, argv, "bextract");
init_msg(NULL, NULL); /* setup message handler */
+ OSDependentInit();
+
ff = init_find_files();
binit(&bfd);
break;
case 'e': /* exclude list */
- if ((fd = fopen(optarg, "r")) == NULL) {
+ if ((fd = fopen(optarg, "rb")) == NULL) {
berrno be;
Pmsg2(0, _("Could not open exclude file: %s, ERR=%s\n"),
optarg, be.strerror());
break;
case 'i': /* include list */
- if ((fd = fopen(optarg, "r")) == NULL) {
+ if ((fd = fopen(optarg, "rb")) == NULL) {
berrno be;
Pmsg2(0, _("Could not open include file: %s, ERR=%s\n"),
optarg, be.strerror());
release_device(dcr);
free_attr(attr);
free_jcr(jcr);
- term_dev(dev);
+ dev->term();
printf(_("%u files restored.\n"), num_files);
return;
bool dir_ask_sysop_to_create_appendable_volume(DCR *dcr) { return 1; }
bool dir_update_file_attributes(DCR *dcr, DEV_RECORD *rec) { return 1;}
bool dir_send_job_status(JCR *jcr) {return 1;}
-VOLRES *new_volume(DCR *dcr, const char *VolumeName) { return NULL; }
-bool free_volume(DEVICE *dev) { return true; }
-void free_unused_volume(DCR *dcr) { }
bool dir_ask_sysop_to_mount_volume(DCR *dcr)
DEVICE *dev = dcr->dev;
fprintf(stderr, _("Mount Volume \"%s\" on device %s and press return when ready: "),
dcr->VolumeName, dev->print_name());
+ dev->close();
getchar();
return true;
}