[Info-vax] callable BACKUP example
Dave Froble
davef at tsoft-inc.com
Fri Jul 9 20:57:02 EDT 2021
On 7/9/2021 8:25 PM, VAXman- at SendSpamHere.ORG wrote:
> In article <00B65888.594833A3 at SendSpamHere.ORG>, VAXman- @SendSpamHere.ORG writes:
>> In article <sc86be$cvo$1 at dont-email.me>, Dave Froble <davef at tsoft-inc.com> writes:
>>> On 7/8/2021 7:11 PM, Chris Townley wrote:
>>>> On 08/07/2021 23:53, Arne Vajhøj wrote:
>>>>> On 7/8/2021 5:42 PM, Chris Townley wrote:
>>>>>> On 08/07/2021 18:49, Arne Vajhøj wrote:
>>>>>>> On 7/8/2021 12:22 PM, VAXman- at SendSpamHere.ORG wrote:
>>>>>>>> Does anybody have the callable BACKUP example in compilable format?
>>>>>>>>
>>>>>>>> Trying to select and copy it from the PDF manual gives me garbage.
>>>>>>>>
>>>>>>>> FWIW, that's the ugliest bit of VMS documentation I have read in a
>>>>>>>> very long while.
>>>>>>>
>>>>>>> I rewrote the example in the manual and ended up with:
>>>>>
>>>>>>> BACKUP/LIST look OK on the result.
>>>>>>>
>>>>>> Always beware of copying/pasting from Word or PDF - it usually does
>>>>>> strange things - especially with quotes!
>>>>>
>>>>> It was more than copy/paste problems.
>>>>>
>>>>> The example in the manual declared a function:
>>>>>
>>>>> unsigned int subtest(void *);
>>>>>
>>>>> without using it.
>>>>>
>>>>> It did:
>>>>>
>>>>> static char input_str[] = "[.wrk]";
>>>>> ...
>>>>> input_dsc.dsc$w_length = sizeof(input_str);
>>>>>
>>>>> which I believe must be off by 1.
>>>>>
>>>>> It did not declare return type of main and it made all variables
>>>>> global instead of local in main, which is valid C but not very
>>>>> good C.
>>>>>
>>>>> Arne
>>>>>
>>>>>
>>>> Ouch!
>>>>
>>>> Chris
>>>>
>>>
>>> "Cut-n-Paste" usually means the user didn't bother to understand the
>>> example/source. That isn't a good idea at any time. The doc examples
>>> are to help one understand, not to be blindly copied.
>>
>> I wanted something quick to play with but copying it from Preview on my
>> Mac to TextEdit produced put unadulterated garbage. What I don't under-
>> stand is why the various macros (C-headers) were never added into the
>> system's libraries. They need to be included from SYS$EXAMPLES. If the
>> *include* files can be placed into SYS$EXAMPLES, why wasn't the example?
>> After perusing that awful BACKUP API documentation, I whipped together a
>> macro example. Far more readable too.
>>
>> If you want to wish you had a migraine a augmented by a hangover from a
>> college toga party coupled with a raging case of herpes, take a gander
>> at that BACKUP API documentation.
>
> In fact, the only thing that I believe could be worse than that BACKUP
> API documentation would be the .SDL that created the awful definitions
> you see in SYS$EXAMPLES.
>
Many years ago I needed to do this. I took a look at the documentation,
then implemented a solution that created a small command file, then
spawned a sub-process to do the backup. Some things aren't worth the
aggravation.
--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef at tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486
More information about the Info-vax
mailing list