(9885) Creating directories with Version Limits?

Archive of the OpenVMS Ask the Wizard (ATW) questions and answers database.
Locked

Topic author
User
Visitor
Posts: 0
Joined: Mon Jan 10, 2022 8:16 am
Reputation: 0
Status: Offline

(9885) Creating directories with Version Limits?

Post by User » Wed Oct 20, 2004 9:26 am

I want to dynamically use version_limit option from my C program when I am creating the file and directory. Just like the commands,

1. CREATE/DIRECTORY/VERSION_LIMIT=5 [JOHN.DOE.MYDIR]
2. SET FILE /VERSION_LIMIT=5 filename.c

Is it possible ? Can you explain with an example ?

Thanks in advance
Sandeep
Last edited by marty.stu on Thu Aug 18, 2022 10:09 am, edited 1 time in total.


Wizard
Visitor
Posts: 0
Joined: Mon Jan 10, 2022 8:17 am
Reputation: 0
Status: Offline

Re: (9885) Creating directories with Version Limits?

Post by Wizard » Thu Oct 21, 2004 9:26 am

See LIBRTL routine LIB$CREATE_DIR

Code: Select all

    LIB$CREATE_DIR device-directory-spec [,owner-UIC]
        [,protection-enable] [,protection-value] [,maximum-versions]
        [,relative-volume-number] [,initial-allocation]

    ...
    maximum-versions

    OpenVMS usage:  word_unsigned
    type:  word (unsigned)
    access:  read only
    mechanism: by reference

    Maximum number of versions allowed for files created in the newly
    created directories. The maximum-versions argument is the address of an
    unsigned word containing the value of the maximum number of versions.
    The maximum-versions argument is optional. The default is the parent
    directory's default version limit. If maximum-versions is zero, the
    maximum number of versions is not limited.
Your "SET FILE/VERSION" is redundant as the setting on the directory will do what you want.
Last edited by marty.stu on Thu Aug 18, 2022 10:10 am, edited 2 times in total.

Locked