Update of /cvsroot/linux-decnet/dnprogs/dncopy
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15553
Modified Files:
dncopy.1 dncopy.cc dnetfile.cc dnetfile_dap.cc
Log Message:
Add -E switch to continue on remote file open error.
Copy better with illegal remote filenames.
Index: dncopy.1
===================================================================
RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/dncopy.1,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** dncopy.1 10 Mar 2006 08:13:16 -0000 1.8
--- dncopy.1 4 Dec 2006 15:29:17 -0000 1.9
***************
*** 16,20 ****
Options:
.br
! [\-vdisklVh] [\-m mode] [\-a record attributes] [\-r record format]
[\-b block size] [\-p VMS protection]
.SH DESCRIPTION
--- 16,20 ----
Options:
.br
! [\-vdisklEVh] [\-m mode] [\-a record attributes] [\-r record format]
[\-b block size] [\-p VMS protection]
.SH DESCRIPTION
***************
*** 161,164 ****
--- 161,169 ----
.I -P.
.TP
+ .I \-E
+ Ignore errors opening output files. This is handy if you are sending a lot
+ of Unix files to VMS, some of which have illegal filenames (eg ~ backup files).
+ dncopy will report an error for each file but continue sending.
+ .TP
.I \-h \-?
Displays help for using the command.
Index: dncopy.cc
===================================================================
RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/dncopy.cc,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** dncopy.cc 10 Mar 2006 15:32:04 -0000 1.10
--- dncopy.cc 4 Dec 2006 15:29:18 -0000 1.11
***************
*** 30,33 ****
--- 30,34 ----
static bool dntype = false;
+ static bool cont_on_error = false;
// Prototypes
***************
*** 234,238 ****
out->perror("Error opening file for output");
in->close();
! return 1;
}
}
--- 235,242 ----
out->perror("Error opening file for output");
in->close();
! if (cont_on_error)
! continue;
! else
! return 1;
}
}
***************
*** 447,451 ****
opterr = 0;
optind = 0;
! while ((opt=getopt(argc,argv,"?Vvhdr:a:b:kislm:p:PD")) != EOF)
{
switch(opt) {
--- 451,455 ----
opterr = 0;
optind = 0;
! while ((opt=getopt(argc,argv,"?Vvhdr:a:b:kislm:p:PDE")) != EOF)
{
switch(opt) {
***************
*** 466,469 ****
--- 470,477 ----
break;
+ case 'E':
+ cont_on_error = true;
+ break;
+
case 'r':
if (tolower(optarg[0]) == 'f') rfm = file::RFM_FIX;
Index: dnetfile.cc
===================================================================
RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/dnetfile.cc,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** dnetfile.cc 5 Jan 2006 19:24:13 -0000 1.7
--- dnetfile.cc 4 Dec 2006 15:29:18 -0000 1.8
***************
*** 191,194 ****
--- 191,195 ----
dap_send_access();
status = dap_get_file_entry(&real_rfm, &real_rat);
+ if (status) return status;
}
status = dap_send_connect();
Index: dnetfile_dap.cc
===================================================================
RCS file: /cvsroot/linux-decnet/dnprogs/dncopy/dnetfile_dap.cc,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** dnetfile_dap.cc 10 Mar 2006 08:13:16 -0000 1.12
--- dnetfile_dap.cc 4 Dec 2006 15:29:18 -0000 1.13
***************
*** 116,120 ****
--- 116,123 ----
int dnetfile::dap_get_file_entry(int *rfm, int *rat)
{
+ char sentname[strlen(filname)+1];
if (verbose > 2) DAPLOG((LOG_INFO, "in dap_get_file_entry()\n"));
+
+ strcpy(sentname, filname); // Save in case of error
dirname[0] = volname[0] = filname[0] = '\0';
***************
*** 177,180 ****
--- 180,188 ----
break;
}
+ if (sm->get_code() == 0x4097) // Name syntax error
+ {
+ fprintf(stderr, "Can't send '%s' : Name is not legal at remote end\n", sentname);
+ return -1;
+ }
return dap_check_status(m,-1);
}
|