[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference visa::ftsv

Title:File Transfer Spooler for VMS
Moderator:ANNECY::BENDRIS
Created:Mon Dec 12 1994
Last Modified:Sat May 24 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:86
Total number of notes:232

85.0. "effect of dsc$w_length in command descriptor" by AWECIM::HANNAN (Beyond description...) Wed Apr 02 1997 22:21

I get error 12 (access violation I believe) when I use callable FTSV (v3) 
and pass a descriptor with a length which exceeds the actual command string.  
Ie, the following produces the error 12:

  static char ftsv_command[512];
  $DESCRIPTOR (ftsv_command_dsc, ftsv_command);	/* dsc$w_length set to 512 */

  strcpy (ftsv_command, "copy a.dat b.dat");
  status = FTSV$FTSV (&ftsv_command_dsc);
  exit (status);

Problem is corrected by assigning the exact length of the passed string to
dsc$w_length, attempted as a last resort:

  static char ftsv_command[512];
  $DESCRIPTOR (ftsv_command_dsc, ftsv_command);	/* dsc$w_length set to 512 */

  strcpy (ftsv_command, "copy a.dat b.dat");
  ftsv_command_dsc.dsc$w_length = strlen(ftsv_command);	 /* prevents error 12 */
  status = FTSV$FTSV (&ftsv_command_dsc);
  exit (status);

Is this expected behavior ?  

Thanks,
Ken
T.RTitleUserPersonal
Name
DateLines
85.1its a coding errorSTAR::BLAKEOpenVMS EngineeringThu Apr 03 1997 16:169
>Is this expected behavior ?  

I don't know if ACCVIO is the *expected* behaviour. I'd be more inclined to 
say that what you were doing would produce "undetermined" results.

The length field in that kind of descriptor contains the number of bytes
USED in the string, not the allocation size.

Colin.
85.2AWECIM::HANNANBeyond description...Fri Apr 04 1997 21:304
Thanks for the reply... C and $DESCRIPTOR leave a little to the imagination
to get em working right sometime depending on the target routine...

/Ken