ACP QIO help request

Share your experience porting VMS applications to x86 here.
Post Reply

Topic author
mberryman
Active Contributor
Posts: 40
Joined: Sat Sep 02, 2023 1:31 pm
Reputation: 0
Location: Colorado Springs, CO, USA
Status: Offline

ACP QIO help request

Post by mberryman » Mon Jun 10, 2024 7:06 pm

I am trying to create a directory using a QIO to the ACP (there are reasons for not using RMS or LIB$ here).
No matter what I try, I get a BADFILENAME result.
This is what I have so far:

Code: Select all

    memset(&fib, 0, FIB$K_LENGTH);
    fib.fib$w_did_num = 4;
    fib.fib$w_did_seq = 4;
    fib.fib$w_did_rvn = 1;
    fib.fib$v_diracl = 1;
    fib.fib$w_nmctl = FIB$M_NAMES_8BIT | FIB$M_NAMES_16BIT;

    ILE2 fib_desc = { FIB$K_LENGTH, 0, &fib };
    ILE2 dir_name = { sizeof(dirname), 0, dirname };

    status = SYS$QIOW( EFN$C_ENF, chan, IO$_CREATE | IO$M_CREATE | IO$M_SETDIR, &iosb, 0, 0,
        &fib_desc,
        (__int64)&dir_name,
        (__int64)&name_len,
        (__int64)&fn_desc,
        0,
        0
    );
The dirname descriptor cycles through several permutations of possible file names with the following results:
3D IOSB status: 2072
3D.DIR IOSB status: 2072
3D.DIR;1 IOSB status: 2080
[3D] IOSB status: 2072
[.3D] IOSB status: 2072

What am I missing/doing wrong?


sms
Master
Posts: 409
Joined: Fri Aug 21, 2020 5:18 pm
Reputation: 0
Status: Offline

Re: ACP QIO help request

Post by sms » Mon Jun 10, 2024 7:39 pm

Code: Select all

> No matter what I try, [...]

   Not a useful description of much, especially without an actual test
case.

   I haven't looked at this stuff in recent years, so I know little, but
you might look at [.vms]vms.c from any version of Info-ZIP UnZip
starting at 6.00.  UnZip uses QIO[W] for some file I/O, which includes
using the funny name storage for ODS5 (nam.naml$l_filesys_name*).
Last edited by sms on Mon Jun 10, 2024 9:48 pm, edited 1 time in total.


jonesd
Valued Contributor
Posts: 90
Joined: Mon Aug 09, 2021 7:59 pm
Reputation: 0
Status: Offline

Re: ACP QIO help request

Post by jonesd » Mon Jun 10, 2024 9:25 pm

mberryman wrote:
Mon Jun 10, 2024 7:06 pm
I am trying to create a directory using a QIO to the ACP (there are reasons for not using RMS or LIB$ here).
No matter what I try, I get a BADFILENAME result.
This is what I have so far:

Code: Select all

    memset(&fib, 0, FIB$K_LENGTH);
    fib.fib$w_did_num = 4;
    fib.fib$w_did_seq = 4;
    fib.fib$w_did_rvn = 1;
    fib.fib$v_diracl = 1;
    fib.fib$w_nmctl = FIB$M_NAMES_8BIT | FIB$M_NAMES_16BIT;

    ILE2 fib_desc = { FIB$K_LENGTH, 0, &fib };
    ILE2 dir_name = { sizeof(dirname), 0, dirname };

    status = SYS$QIOW( EFN$C_ENF, chan, IO$_CREATE | IO$M_CREATE | IO$M_SETDIR, &iosb, 0, 0,
        &fib_desc,
        (__int64)&dir_name,
        (__int64)&name_len,
        (__int64)&fn_desc,
        0,
        0
    );
I am unfamiliar with the IO$M_SETDIR modifier, I don't see it mentioned in the I/O User's Reference Manual under ACP operations. Should the dirname descriptor have sizeof of the buffer or the length(strlen()) of the string? I believe the filename also has to have a .DIR;1 type and version.


Topic author
mberryman
Active Contributor
Posts: 40
Joined: Sat Sep 02, 2023 1:31 pm
Reputation: 0
Location: Colorado Springs, CO, USA
Status: Offline

Re: ACP QIO help request

Post by mberryman » Mon Jun 10, 2024 10:08 pm

Sorry. It appears I wasn't clear.

The first piece of the output I showed is the value I tried as the dirname parameter. So I have tried:
"3D"
"3D.DIR"
"3D.DIR;1 "
"[3D]"
"[.3D]"

In each case the result is BADFILENAME (2072), except for the 3rd case where the result is BADFILEVER (2080).

Added in 7 minutes 41 seconds:
And after staring at this all day and writing this plea for help, I finally saw the dumb mistake in the code and it is now working. As it turns out, the first syntax is the correct one.

User avatar

arne_v
Master
Posts: 438
Joined: Fri Apr 17, 2020 7:31 pm
Reputation: 0
Location: Rhode Island, USA
Status: Offline
Contact:

Re: ACP QIO help request

Post by arne_v » Mon Jun 10, 2024 10:16 pm

This may be a stupid question, but is:

sizeof(dirname)

good?
Arne
arne@vajhoej.dk
VMS user since 1986

Post Reply