|
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-
bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Wednesday, April 30, 2008 7:06 PM
To: Midrange Systems Technical Discussion
Subject: Re: Reading From an NFS
Hello Hoss,
When I open the file it returns a handle gHandle =
open(%trim(fnwithdir): O_RDONLY: S_IRWXU + S_IRWXG + S_IRWXO);
This isn't the problem, but... just a note: the S_xxx flags are not
going to be used in the above example. The S_xxx flags are only used
if
you specify O_CREAT. So the following code would be identical to what
you have:
gHandle = open(%trim(fnwithdir): O_RDONLY);
When I read the file gBytes is 0 Zero. gBytes = read(gHandle:
gDataPtr: gDataPtrSize);
What are gDataPtr and gDataPtrSize? How are they defined? What are
they set to?
Most commonly, an RPG program calling the read() API would look more
like this:
gBytes = read(gHandle: %addr(someVar): %size(someVar));
For certain, you can provide your own pointer and your own size
variable
instead of using a preexisting RPG variable -- but please make sure you
specify valid values for them... If you set them wrong, you could very
well have the issue you're describing (that it can't read the data)
However, aside from that, I don't see anything wrong. I tried your
code
(filling in the blanks as best I could) and was able to successfully
read a file from my NFS server. Granted, my NFS server is running
FreeBSD rather than Windows, but I don't see why that would matter...
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
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.