× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hello Antonio,

> To read a file I pass its full name, which I've ckecked and gets
> correctly to the program, eg     /etc/magic
> The handle = openStreamFile (...) is rejected (-1), and I've checked the
> ERRNO is 3025 which means "no such file or library"
> Also tried with other files, with same result.

I'm not familiar with "openStreamFile"?!  Perhaps you're renaming the
open() API to be called openStreamFile()?

The only thing that I can think of is that you're forgetting to trim the
spaces off of the end of your filenames....   Remember, spaces ARE allowed
in a filename.  You probably realize that a file called
"/etc/magic carpet ride" is allowed.  Do you realize that a file called
"/etc/magic            " is also allowed?  And having those spaces at the
end of the filename makes it different from "/etc/magic".

My guess is that your file is called "/etc/magic" but you're passing
"/etc/magic         "  to the API, and therefore it can't find the file.


> Am I supposed to pass the file name as      /etc/magic.stmf      or
> something like it, i.e. with some extension? Tried different
> combinations to no help.

No.  The filename is exactly the same as it would be with WRKLNK.


> I've writen another program, just to write a file of my own, just to
> test the previous one, and wrote a new file as
>     /etc/Prueba         (no extension, "P" uppercase, just in case it
> matters...)

The "P" uppercase only matters in the /QOpenSys filesystem.  So, if the
file is called "/QOpenSys/etc/Prueba" then the capitalization matters.  If
it's just "/etc/Prueba" then it doesn't matter.


> After execution, it shows up in    wrklnk  '/etc'
> So, I go back to first program, and try to read it from   /etc/Prueba
>   and again get same 3025  error.
>
> Any clues or suggestions?

Make sure you're trimming the spaces, as I explained above.


>
> Problem2:
> By the way, the file /etc/Prueba   I wrote was made up of 5 consecutive
> writes with  " putStreamFile " of a fixed text of all 26 capital letters
> of the alphabet. When I did the    wrklnk  '/etc'   and got to Prueba,
> did a display (5)  and what I got was the 130 letters in a row... all in
> one single string.

Again, I'm not familiar with "putStreamFile".  You are clearly renaming a
different API, or else this is a routine in a service program that you
wrote, rather than being an actual IBM API.

If you want help with them, you'll have to tell us the name of the IBM
API, or post the code for the putStreamFile routine.

If you do post code, make sure you do it to the correct mailing list.  For
RPG code, post it to RPG400-L, for cobol code to COBOL400-L, for C code
post it to C400-L.  Only if (somehow) you're doing this in CL, then
Midrange-L is the proper place.


> What I want to end up reading will be some text files passed from a PC
> application, which I assume will be in some "plain text" format, may be
> as    "xxx . txt" or the like, so I expect it to have different lines
> with CR+LF at end of each record.
>
> If, in the end, I manage to read that file (assuming I get Problem1
> first solved...), reading it with   "getStreamFile" will  read it as a
> hugh buffer (of the size I give) or will I get it one record at the time???

Again, I've never heard of "getStreamFile"??  Again, tell us the name of
the API that you're calling, or post the code if it's a routine that you
wrote. If this is the fgets() API, it will one "record" at a time (one line
of text, actually) if it is the read() or fread() API, then it will read a
block of bytes...

To avoid this sort of problem in the future, I recommend that you name the
APIs in your programs with the same names that they're given in the
manuals.  This makes it much easier for the next person to read your
program (or for people trying to answer your questions on mailing lists.)

Hope that helps...

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.