All,
I am attempting to create a new file on the IFS using Scott Klements
prototypes in the IFSIO_H source member from his e-book.
The following is a part of the code showing the defines and the open:

* Copy prototypes for IFS processing

/Copy QCopyBks,IFSIO_H

/Copy QCopyBks,IFSTEXT_H

* Copy API Error constants and prototypes

/Copy QCopyBks,ErrNo_H

D Path_Name S 256A Varying

D File_Name S 128A Varying

D openflags S 10I 0

D mode S 10U 0

D ccsid S 10U 0

D txtcreatid S 10U 0

// Pointer to file name

D File S 10I 0

// Pointer to buffer for IFS Write

D p_writeBuf S * Inz(%Addr(WriteBuf))

// Buffer area for IFS Write

D Writebuf S 80A

D ErrMsg S 80A

D Rc S 10I 0

/Free

*InLr = *On;

Path_Name = '/home/vaijy';

File_Name = 'TEST.CSV';

// Create file, Write Only, Convert Text to Code Page, Open in TEXT mode,

// Create only

OpenFlags = O_CREAT + O_WRONLY + O_CODEPAGE + O_TEXTDATA

+ O_TEXT_CREAT;

// Authority - Owner All, Group All, Others All

Mode = S_IRWXU + S_IRWXG + S_IRWXO;

// Convert to Code Page 1252 (Windows AscII)

CCsId = 1252;

// Get file handle and open file for write only

File = Open(%TrimR(Path_Name) + '/' + %TrimR(File_Name)

: OpenFlags

: Mode

: TxtCreatId

);

If File < *Zero; // Error on file

p_ErrNo = Sys_ErrNo(); // Get Error number

ErrMsg = %Str(StrError(ErrNo)); // Load Error Message Text

Return;

EndIf;

I am receiving the following error from the open:
*The value specified for the argument is not correct.
*
What am I doing wrong?

Thanks,
Jeff Young
Sr. Programmer Analyst

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.